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;