mobile: enable auto sync

This commit is contained in:
Ammar Ahmed
2024-03-01 22:45:55 +05:00
committed by Abdullah Atta
parent b80dd8c81e
commit 4e5b5e6e3f
2 changed files with 6 additions and 9 deletions

View File

@@ -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) => {

View File

@@ -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");