From 2f17ad69a16d06cb8f5bb0ada3bfedd2db51472c Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Thu, 22 Feb 2024 13:45:21 +0500 Subject: [PATCH] mobile: disable auto sync --- apps/mobile/app/hooks/use-app-events.tsx | 13 ++++++++----- apps/mobile/app/services/background-sync.ts | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/mobile/app/hooks/use-app-events.tsx b/apps/mobile/app/hooks/use-app-events.tsx index c62eb7120..99fc62b22 100644 --- a/apps/mobile/app/hooks/use-app-events.tsx +++ b/apps/mobile/app/hooks/use-app-events.tsx @@ -202,11 +202,14 @@ const onRequestPartialSync = async ( DatabaseLogger.info( `onRequestPartialSync full:${full}, force:${force}, lastSyncTime:${lastSyncTime}` ); - if (full || force) { - await Sync.run("global", force, full, undefined, lastSyncTime); - } else { - await Sync.run("global", false, false, undefined, 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); + // } }; const onLogout = async (reason: string) => { diff --git a/apps/mobile/app/services/background-sync.ts b/apps/mobile/app/services/background-sync.ts index 5da6a277a..084ee11e6 100644 --- a/apps/mobile/app/services/background-sync.ts +++ b/apps/mobile/app/services/background-sync.ts @@ -114,7 +114,8 @@ async function onBackgroundSyncStarted() { } const user = await db.user?.getUser(); if (user) { - await db.sync(true, false); + // await db.sync(true, false); + DatabaseLogger.info("BACKGROUND SYNC DISABLED"); } await Notifications.setupReminders(); DatabaseLogger.info("BACKGROUND SYNC COMPLETE");