fix: hasEditor not always working

This commit is contained in:
Radek Czemerys
2020-10-06 14:35:29 +02:00
parent 7fc5e45083
commit a3ea454979
3 changed files with 4 additions and 4 deletions

View File

@@ -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 }) => {

View File

@@ -146,9 +146,9 @@ export const useHasEditor = () => {
}
);
return removeEditorObserver;
});
}, [application]);
return hasEditor;
return [hasEditor];
};
export const useSyncStatus = () => {

View File

@@ -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