Don't reschedule bg checks if app is restarted

This commit is contained in:
Imran Remtulla
2023-08-22 17:13:15 -04:00
parent 82e08150ab
commit 9eb32ae55a
2 changed files with 36 additions and 13 deletions

View File

@@ -318,4 +318,16 @@ class SettingsProvider with ChangeNotifier {
prefs?.setBool('enableBackgroundUpdates', val);
notifyListeners();
}
DateTime get lastBGCheckTime {
int? temp = prefs?.getInt('lastBGCheckTime');
return temp != null
? DateTime.fromMillisecondsSinceEpoch(temp)
: DateTime.fromMillisecondsSinceEpoch(0);
}
set lastBGCheckTime(DateTime val) {
prefs?.setInt('lastBGCheckTime', val.millisecondsSinceEpoch);
notifyListeners();
}
}