mirror of
https://github.com/standardnotes/mobile.git
synced 2026-02-23 01:56:27 -05:00
fix: hasEditor not always working
This commit is contained in:
@@ -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 }) => {
|
||||
|
||||
@@ -146,9 +146,9 @@ export const useHasEditor = () => {
|
||||
}
|
||||
);
|
||||
return removeEditorObserver;
|
||||
});
|
||||
}, [application]);
|
||||
|
||||
return hasEditor;
|
||||
return [hasEditor];
|
||||
};
|
||||
|
||||
export const useSyncStatus = () => {
|
||||
|
||||
@@ -31,7 +31,7 @@ export const Root = (): JSX.Element | null => {
|
||||
const [, setWidth] = useState<number | undefined>(undefined);
|
||||
const [height, setHeight] = useState<number | undefined>(undefined);
|
||||
const [, setX] = useState<number | undefined>(undefined);
|
||||
const hasEditor = useHasEditor();
|
||||
const [hasEditor] = useHasEditor();
|
||||
const [noteListCollapsed, setNoteListCollapsed] = useState<boolean>(false);
|
||||
const [shouldSplitLayout, setShouldSplitLayout] = useState<
|
||||
boolean | undefined
|
||||
|
||||
Reference in New Issue
Block a user