diff --git a/mobile/lib/services/update_service.dart b/mobile/lib/services/update_service.dart index 28c5732c8..e18d8548c 100644 --- a/mobile/lib/services/update_service.dart +++ b/mobile/lib/services/update_service.dart @@ -73,9 +73,13 @@ class UpdateService { return _latestVersion; } - Future shouldShowUpdateNoification() async { + Future shouldShowUpdateNotification() async { final shouldUpdate = await this.shouldUpdate(); + if (!shouldUpdate) { + return false; + } + final lastNotificationShownTime = _prefs.getInt(kUpdateAvailableShownTimeKey) ?? 0; final now = DateTime.now().microsecondsSinceEpoch; @@ -87,7 +91,7 @@ class UpdateService { } Future showUpdateNotification() async { - if (await shouldShowUpdateNoification()) { + if (await shouldShowUpdateNotification()) { // ignore: unawaited_futures NotificationService.instance.showNotification( "Update available", diff --git a/mobile/lib/ui/tabs/home_widget.dart b/mobile/lib/ui/tabs/home_widget.dart index 4b2c38ce5..ddad5073b 100644 --- a/mobile/lib/ui/tabs/home_widget.dart +++ b/mobile/lib/ui/tabs/home_widget.dart @@ -195,7 +195,7 @@ class _HomeWidgetState extends State { }, ); _initDeepLinks(); - UpdateService.instance.shouldShowUpdateNoification().then((value) { + UpdateService.instance.shouldShowUpdateNotification().then((value) { Future.delayed(Duration.zero, () { if (value) { showDialog(