Skip to content

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

mobile: fix ios app does not load if awaited RNBootSplash.hide

Ammar Ahmede4fa0e9f0b3f
diff --git a/apps/mobile/app/app.tsx b/apps/mobile/app/app.tsx
index 40d17fe49..96b8a6fe7 100644
--- a/apps/mobile/app/app.tsx
+++ b/apps/mobile/app/app.tsx
@@ -74,6 +74,7 @@ const App = (props: { configureMode: "note-preview" }) => {
}, [introCompleted]);
useEffect(() => {
+ RNBootSplash.hide({ fade: true });
SettingsService.onFirstLaunch();
changeSystemBarColors();
SettingsService.setPrivacyScreen(
@@ -194,21 +195,24 @@ export const withStartupBoundry = (
useEffect(() => {
async function init() {
- const [url, shortcut] = await Promise.all([
- Linking.getInitialURL(),
- Shortcuts.getInitialShortcut()
- ]);
- if (shortcut?.type === "notesnook.action.newnote") {
- launchNewNoteTab();
+ try {
+ const [url, shortcut] = await Promise.all([
+ Linking.getInitialURL(),
+ Shortcuts.getInitialShortcut()
+ ]);
+ console.log(url, shortcut);
+ if (shortcut?.type === "notesnook.action.newnote") {
+ launchNewNoteTab();
+ }
+ useSettingStore.setState({
+ initialUrl: url,
+ pendingShortcut: shortcut ?? null
+ });
+
+ initShortcutListener();
+ } finally {
+ setReady(true);
}
- useSettingStore.setState({
- initialUrl: url,
- pendingShortcut: shortcut ?? null
- });
-
- initShortcutListener();
- await RNBootSplash.hide({ fade: true });
- setReady(true);
}
init();