Skip to content

Commit

Permalink
4.2.0+402018
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Sep 20, 2023
1 parent c58f5e4 commit bdfa6f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/state_notifiers/settings_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class SettingsNotifier extends StateNotifier<SettingsState> {
}

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);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/push_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ abstract class PushProvider {
List<PushToken> pushTokens = globalRef?.read(tokenProvider).tokens.whereType<PushToken>().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;
Expand Down

0 comments on commit bdfa6f8

Please sign in to comment.