From f6eafd576e5400ca650cf291a9ae9b6cc2facf34 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Thu, 14 Mar 2024 18:28:07 +0100 Subject: [PATCH] fix: Do not sync in background mode --- lib/main.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 877f80da3..d9ac10b4c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -32,6 +32,7 @@ void main() async { AppLifecycleState.detached == WidgetsBinding.instance.lifecycleState) { // Do not send online presences when app is in background fetch mode. for (final client in clients) { + client.backgroundSync = false; client.syncPresence = PresenceType.offline; } @@ -94,6 +95,7 @@ class AppStarter with WidgetsBindingObserver { ); // Switching to foreground mode needs to reenable send online sync presence. for (final client in clients) { + client.backgroundSync = true; client.syncPresence = PresenceType.online; } startGui(clients, store);