fix: Do not sync in background mode
This commit is contained in:
parent
c028c69b2d
commit
f6eafd576e
1 changed files with 2 additions and 0 deletions
|
|
@ -32,6 +32,7 @@ void main() async {
|
||||||
AppLifecycleState.detached == WidgetsBinding.instance.lifecycleState) {
|
AppLifecycleState.detached == WidgetsBinding.instance.lifecycleState) {
|
||||||
// Do not send online presences when app is in background fetch mode.
|
// Do not send online presences when app is in background fetch mode.
|
||||||
for (final client in clients) {
|
for (final client in clients) {
|
||||||
|
client.backgroundSync = false;
|
||||||
client.syncPresence = PresenceType.offline;
|
client.syncPresence = PresenceType.offline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -94,6 +95,7 @@ class AppStarter with WidgetsBindingObserver {
|
||||||
);
|
);
|
||||||
// Switching to foreground mode needs to reenable send online sync presence.
|
// Switching to foreground mode needs to reenable send online sync presence.
|
||||||
for (final client in clients) {
|
for (final client in clients) {
|
||||||
|
client.backgroundSync = true;
|
||||||
client.syncPresence = PresenceType.online;
|
client.syncPresence = PresenceType.online;
|
||||||
}
|
}
|
||||||
startGui(clients, store);
|
startGui(clients, store);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue