Skip to content

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

feat: don't wait for sync to finish after auth success

thecodrr71d699b4e688
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)"}
</Text>
</Button>
- {SyncStatus && (
- <Button
- variant="statusitem"
- display="flex"
- onClick={sync}
- sx={{ alignItems: "center", justifyContent: "center" }}
- >
- <SyncStatus />
- </Button>
- )}
+
+ <Button
+ variant="statusitem"
+ display="flex"
+ onClick={sync}
+ sx={{ alignItems: "center", justifyContent: "center" }}
+ >
+ <SyncStatus />
+ </Button>
</>
) : (
<Button
@@ -150,7 +149,7 @@ function SyncStatus() {
const syncStatus = useAppStore((state) => state.syncStatus);
const lastSynced = useAppStore((state) => state.lastSynced);
- if (!lastSynced) return null;
+ if (!lastSynced && syncStatus === "synced") return null;
switch (syncStatus) {
case "synced":
return (
diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js
index b49ca2600..adff073e4 100644
--- a/apps/web/src/stores/user-store.js
+++ b/apps/web/src/stores/user-store.js
@@ -87,7 +87,6 @@ class UserStore extends BaseStore {
await db.connectSSE();
}
});
- await appStore.sync();
return true;
});
};
diff --git a/apps/web/src/views/auth.js b/apps/web/src/views/auth.js
index 67b513262..fee84f648 100644
--- a/apps/web/src/views/auth.js
+++ b/apps/web/src/views/auth.js
@@ -95,7 +95,7 @@ const authTypes = {
},
loading: {
title: "Logging you in",
- text: "Please wait while your data is downloaded & decrypted.",
+ text: "Please wait while you are authenticated.",
},
supportsPasswordRecovery: true,
onSubmit: async (form, onError) => {