diff --git a/src/AppStack.tsx b/src/AppStack.tsx index 25347402..a323a2cd 100644 --- a/src/AppStack.tsx +++ b/src/AppStack.tsx @@ -98,7 +98,7 @@ export const AppStackComponent = ( return removeObserver; }, [application, props.navigation, isInTabletMode]); - const hasEditor = useHasEditor(); + const [hasEditor] = useHasEditor(); useEffect(() => { const updateDimensions = ({ window }: { window: ScaledSize }) => { diff --git a/src/lib/snjs_helper_hooks.ts b/src/lib/snjs_helper_hooks.ts index cf3915c3..e388b4f6 100644 --- a/src/lib/snjs_helper_hooks.ts +++ b/src/lib/snjs_helper_hooks.ts @@ -146,9 +146,9 @@ export const useHasEditor = () => { } ); return removeEditorObserver; - }); + }, [application]); - return hasEditor; + return [hasEditor]; }; export const useSyncStatus = () => { diff --git a/src/screens/Root.tsx b/src/screens/Root.tsx index 0dc5f2c3..2f03f27b 100644 --- a/src/screens/Root.tsx +++ b/src/screens/Root.tsx @@ -31,7 +31,7 @@ export const Root = (): JSX.Element | null => { const [, setWidth] = useState(undefined); const [height, setHeight] = useState(undefined); const [, setX] = useState(undefined); - const hasEditor = useHasEditor(); + const [hasEditor] = useHasEditor(); const [noteListCollapsed, setNoteListCollapsed] = useState(false); const [shouldSplitLayout, setShouldSplitLayout] = useState< boolean | undefined