From bdfa6f8fe01cf909b5c6ed18bd2cdbb6328fd209 Mon Sep 17 00:00:00 2001 From: Frank Merkel <138444693+frankmer@users.noreply.github.com> Date: Wed, 20 Sep 2023 17:08:49 +0200 Subject: [PATCH] 4.2.0+402018 --- lib/state_notifiers/settings_notifier.dart | 4 ++-- lib/utils/push_provider.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/state_notifiers/settings_notifier.dart b/lib/state_notifiers/settings_notifier.dart index 200bb3975..2d679ffe0 100644 --- a/lib/state_notifiers/settings_notifier.dart +++ b/lib/state_notifiers/settings_notifier.dart @@ -61,12 +61,12 @@ class SettingsNotifier extends StateNotifier { } void enablePolling() { - Logger.info('Polling set to true', name: 'settings_notifier.dart#setPolling'); + Logger.info('Polling set to true', name: 'settings_notifier.dart#enablePolling'); state = state.copyWith(enablePolling: true); } void disablePolling() { - Logger.info('Polling set to false', name: 'settings_notifier.dart#setPolling'); + Logger.info('Polling set to false', name: 'settings_notifier.dart#disablePolling'); state = state.copyWith(enablePolling: false); } diff --git a/lib/utils/push_provider.dart b/lib/utils/push_provider.dart index 328aadd0f..fc62a2a50 100644 --- a/lib/utils/push_provider.dart +++ b/lib/utils/push_provider.dart @@ -190,7 +190,7 @@ abstract class PushProvider { List pushTokens = globalRef?.read(tokenProvider).tokens.whereType().where((t) => t.isRolledOut && t.url != null).toList() ?? []; // Disable polling if no push tokens exist - if (pushTokens.isEmpty) { + if (pushTokens.isEmpty && globalRef?.read(settingsProvider).enablePolling == true) { Logger.info('No push token is available for polling, polling is disabled.', name: 'push_provider.dart#pollForChallenges'); globalRef?.read(settingsProvider.notifier).disablePolling(); return null;