mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
feat: don't wait for sync to finish after auth success
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -87,7 +87,6 @@ class UserStore extends BaseStore {
|
||||
await db.connectSSE();
|
||||
}
|
||||
});
|
||||
await appStore.sync();
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user