Skip to content

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

mobile: enable auto sync

Ammar Ahmed4e5b5e6e3f65
diff --git a/apps/mobile/app/hooks/use-app-events.tsx b/apps/mobile/app/hooks/use-app-events.tsx
index 041e2867f..8f073d674 100644
--- a/apps/mobile/app/hooks/use-app-events.tsx
+++ b/apps/mobile/app/hooks/use-app-events.tsx
@@ -203,13 +203,11 @@ const onRequestPartialSync = async (
`onRequestPartialSync full:${full}, force:${force}, lastSyncTime:${lastSyncTime}`
);
- DatabaseLogger.info("Auto sync is disabled");
-
- // if (full || force) {
- // await Sync.run("global", force, full, undefined, lastSyncTime);
- // } else {
- // await Sync.run("global", false, false, undefined, lastSyncTime);
- // }
+ if (full || force) {
+ await Sync.run("global", force, full, undefined, lastSyncTime);
+ } else {
+ await Sync.run("global", false, false, undefined, lastSyncTime);
+ }
};
const onLogout = async (reason: string) => {
diff --git a/apps/mobile/app/services/background-sync.ts b/apps/mobile/app/services/background-sync.ts
index 084ee11e6..5da6a277a 100644
--- a/apps/mobile/app/services/background-sync.ts
+++ b/apps/mobile/app/services/background-sync.ts
@@ -114,8 +114,7 @@ async function onBackgroundSyncStarted() {
}
const user = await db.user?.getUser();
if (user) {
- // await db.sync(true, false);
- DatabaseLogger.info("BACKGROUND SYNC DISABLED");
+ await db.sync(true, false);
}
await Notifications.setupReminders();
DatabaseLogger.info("BACKGROUND SYNC COMPLETE");