diff --git a/src/client/containers/NoteMenuBar.tsx b/src/client/containers/NoteMenuBar.tsx index a4c2b818..1449ba21 100644 --- a/src/client/containers/NoteMenuBar.tsx +++ b/src/client/containers/NoteMenuBar.tsx @@ -52,7 +52,10 @@ export const NoteMenuBar = () => { // =========================================================================== const [uuidCopiedText, setUuidCopiedText] = useState('') - const [isToggled, togglePreviewIcon] = useState(false) + + // not necessory to use another state here as we have previewMarkdown + // const [isToggled, togglePreviewIcon] = useState(false) + const { previewMarkdown } = useSelector(getSettings) // =========================================================================== // Hooks @@ -98,7 +101,7 @@ export const NoteMenuBar = () => { _updateCodeMirrorOption('theme', darkTheme ? 'base16-light' : 'new-moon') } const togglePreviewHandler = () => { - togglePreviewIcon(!isToggled) + // togglePreviewIcon(!isToggled) _togglePreviewMarkdown() } @@ -111,12 +114,12 @@ export const NoteMenuBar = () => { onClick={togglePreviewHandler} data-testid={TestID.PREVIEW_MODE} > - {isToggled ? ( + {previewMarkdown ? (