From 8ca653f84cc618bb34802d27e747220ea48c2b3a Mon Sep 17 00:00:00 2001 From: iqfareez Date: Fri, 19 Feb 2021 16:05:50 +0800 Subject: [PATCH] :rocket: 1.13.91-hotfix2+43 Notification two days limit --- lib/utils/prevent_update_notifs.dart | 8 +++----- lib/views/Settings part/NotificationSettingPage.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/utils/prevent_update_notifs.dart b/lib/utils/prevent_update_notifs.dart index 37010aa..c55c698 100644 --- a/lib/utils/prevent_update_notifs.dart +++ b/lib/utils/prevent_update_notifs.dart @@ -1,7 +1,5 @@ -//If less than 3 days, since the last notif is scheduled, do not rescehdule -//3 days = 259200000 millis -//15 seconds = 15000 -//4 hours = 14400000 +//If less than 2 days, since the last notif is scheduled, do not rescehdule + import 'package:fluttertoast/fluttertoast.dart'; import 'package:get_storage/get_storage.dart'; import 'package:waktusolatmalaysia/CONSTANTS.dart'; @@ -22,7 +20,7 @@ class PreventUpdatingNotifs { //check if same month or mot, notification will update if not in the month if ((DateTime.now().millisecondsSinceEpoch - GetStorage().read(kStoredLastUpdateNotif)) < - 259200000) { + Duration(days: 2).inMilliseconds) { //check if certain period o time has reached dontUpdateNotification(GetStorage().read(kIsDebugMode)); } else { diff --git a/lib/views/Settings part/NotificationSettingPage.dart b/lib/views/Settings part/NotificationSettingPage.dart index f3916a5..567d1c5 100644 --- a/lib/views/Settings part/NotificationSettingPage.dart +++ b/lib/views/Settings part/NotificationSettingPage.dart @@ -145,7 +145,7 @@ class _NotificationPageSettingState extends State { builder: (BuildContext context) { return AlertDialog( content: Text( - 'By default, notifications will get rescheduled on app reopening after three days since last scheduling.\n\nTap proceed to start an immediate notification scheduling. The app will be restart.'), + 'By default, notification will not rescheduled if the last scheduler ran is less than two days.\n\nTap proceed to start an immediate notification scheduling. The app will be restarted.'), actions: [ TextButton( onPressed: () { diff --git a/pubspec.yaml b/pubspec.yaml index 0703a1b..e26b1f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: App waktu solat seluruh Malaysia publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 1.13.89-hotfix+42 +version: 1.13.91-hotfix2+43 environment: sdk: ">=2.7.0 <3.0.0"