From 71d699b4e688fd5d30a415c539434c9e9468a11d Mon Sep 17 00:00:00 2001 From: thecodrr Date: Mon, 15 Nov 2021 10:33:55 +0500 Subject: [PATCH] feat: don't wait for sync to finish after auth success --- apps/web/src/app-effects.js | 7 +++++-- apps/web/src/components/status-bar/index.js | 21 ++++++++++----------- apps/web/src/stores/user-store.js | 1 - apps/web/src/views/auth.js | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/apps/web/src/app-effects.js b/apps/web/src/app-effects.js index 0c799599b..41e478d57 100644 --- a/apps/web/src/app-effects.js +++ b/apps/web/src/app-effects.js @@ -24,6 +24,7 @@ if (process.env.NODE_ENV === "production") { export default function AppEffects({ setShow }) { const refreshColors = useStore((store) => store.refreshColors); + const sync = useStore((store) => store.sync); const refreshMenuPins = useStore((store) => store.refreshMenuPins); const updateLastSynced = useStore((store) => store.updateLastSynced); const setProcessingStatus = useStore((store) => store.setProcessingStatus); @@ -39,14 +40,16 @@ export default function AppEffects({ setShow }) { refreshMenuPins(); initNotes(); (async function () { - await initUser(); await updateLastSynced(); await resetReminders(); setIsVaultCreated(await db.vault.exists()); - await showUpgradeReminderDialogs(); + await initUser(); + showUpgradeReminderDialogs(); + await sync(); })(); }, [ + sync, updateLastSynced, refreshColors, refreshMenuPins, diff --git a/apps/web/src/components/status-bar/index.js b/apps/web/src/components/status-bar/index.js index 19e795cf8..4b47ee3b2 100644 --- a/apps/web/src/components/status-bar/index.js +++ b/apps/web/src/components/status-bar/index.js @@ -57,16 +57,15 @@ function StatusBar() { {user.isEmailConfirmed ? "" : " (not verified)"} - {SyncStatus && ( - - )} + + ) : (