mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
mobile: fix stuck at loading in editor
This commit is contained in:
@@ -1040,6 +1040,17 @@ export const useEditor = (
|
||||
}, [isDefaultEditor, restoreEditorState]);
|
||||
|
||||
const onLoad = useCallback(async () => {
|
||||
const isAppLoading = useSettingStore.getState().isAppLoading;
|
||||
if (isAppLoading) {
|
||||
const sub = useSettingStore.subscribe((state) => {
|
||||
if (!state.isAppLoading) {
|
||||
sub();
|
||||
onLoad();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
postMessage(NativeEvents.theme, theme);
|
||||
});
|
||||
@@ -1082,9 +1093,8 @@ export const useEditor = (
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
state.current.initialLoadCalled = true;
|
||||
}
|
||||
state.current.initialLoadCalled = true;
|
||||
overlay(false);
|
||||
}
|
||||
}, [
|
||||
|
||||
Reference in New Issue
Block a user