Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix stuck at loading in editor

Ammar Ahmedae9e80e12e6a
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
index bef1acfcf..2a480f734 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
@@ -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);
}
}, [