Fix update checker for iOS

This commit is contained in:
vishnukvmd 2024-04-24 10:54:37 +05:30
parent 88e34683ee
commit 50b6d95ec2
2 changed files with 7 additions and 3 deletions

View file

@ -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",

View file

@ -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(