diff --git a/frontend/src/Project/DisplayControls/LabeledControls/CellsOpacitySlider.js b/frontend/src/Project/DisplayControls/LabeledControls/CellsOpacitySlider.js index bbb7cc24..68684ea8 100644 --- a/frontend/src/Project/DisplayControls/LabeledControls/CellsOpacitySlider.js +++ b/frontend/src/Project/DisplayControls/LabeledControls/CellsOpacitySlider.js @@ -3,7 +3,7 @@ import Slider from '@mui/material/Slider'; // import Tooltip from '@mui/material/Tooltip'; import { useSelector } from '@xstate/react'; import React, { useEffect } from 'react'; -import { useLabeled, useMousetrapRef } from '../../ProjectContext'; +import { useLabeled, useMousetrapRef, useLabelMode } from '../../ProjectContext'; let numMounted = 0; @@ -18,6 +18,9 @@ function CellsOpacitySlider() { const handleDoubleClick = () => labeled.send({ type: 'SET_CELLS_OPACITY', opacity: 0.3 }); // [0.3, 1] for range slider + const labelMode = useLabelMode(); + const isCellTypes = useSelector(labelMode, (state) => state.matches('editCellTypes')); + useEffect(() => { const listener = (e) => { if (e.key === 'z') { @@ -47,7 +50,7 @@ function CellsOpacitySlider() { return ( Z} placement='right'> );