Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix update checker for iOS

vishnukvmd50b6d95ec229
diff --git a/mobile/lib/services/update_service.dart b/mobile/lib/services/update_service.dart
index 28c5732c8d..e18d8548c6 100644
--- a/mobile/lib/services/update_service.dart
+++ b/mobile/lib/services/update_service.dart
@@ -73,9 +73,13 @@ class UpdateService {
return _latestVersion;
}
- Future<bool> shouldShowUpdateNoification() async {
+ Future<bool> 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<void> 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 4b2c38ce58..ddad5073b0 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<HomeWidget> {
},
);
_initDeepLinks();
- UpdateService.instance.shouldShowUpdateNoification().then((value) {
+ UpdateService.instance.shouldShowUpdateNotification().then((value) {
Future.delayed(Duration.zero, () {
if (value) {
showDialog(