mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 12:12:54 +01:00
fix: auto sync not working on startup
This commit is contained in:
@@ -64,6 +64,10 @@ export default function AppEffects({ setShow }) {
|
||||
}
|
||||
);
|
||||
|
||||
EV.subscribe(EVENTS.databaseSyncRequested, async (full, force) => {
|
||||
await sync(full, force);
|
||||
});
|
||||
|
||||
initAttachments();
|
||||
refreshNavItems();
|
||||
initNotes();
|
||||
|
||||
@@ -42,11 +42,7 @@ class UserStore extends BaseStore {
|
||||
return db.user.fetchUser().then(async (user) => {
|
||||
if (!user) return false;
|
||||
|
||||
EV.remove(
|
||||
EVENTS.userSubscriptionUpdated,
|
||||
EVENTS.userEmailConfirmed,
|
||||
EVENTS.databaseSyncRequested
|
||||
);
|
||||
EV.remove(EVENTS.userSubscriptionUpdated, EVENTS.userEmailConfirmed);
|
||||
|
||||
this.set((state) => {
|
||||
state.user = user;
|
||||
@@ -66,10 +62,6 @@ class UserStore extends BaseStore {
|
||||
hashNavigate("/confirmed");
|
||||
});
|
||||
|
||||
EV.subscribe(EVENTS.databaseSyncRequested, async (full, force) => {
|
||||
await appStore.sync(full, force);
|
||||
});
|
||||
|
||||
EV.subscribe(EVENTS.userLoggedOut, async (reason) => {
|
||||
this.set((state) => {
|
||||
state.user = {};
|
||||
|
||||
Reference in New Issue
Block a user