From a46ceebf1907c8ff3e121a94cdf6cbb0cc857a80 Mon Sep 17 00:00:00 2001 From: nyne Date: Wed, 18 Jun 2025 16:07:36 +0800 Subject: [PATCH] Fixed the issue where the update dialog was not showed on startup. --- lib/init.dart | 3 +-- lib/pages/settings/about.dart | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/init.dart b/lib/init.dart index 88549d9..48d40da 100644 --- a/lib/init.dart +++ b/lib/init.dart @@ -95,8 +95,7 @@ Future _checkAppUpdates() async { appdata.writeImplicitData(); ComicSourcePage.checkComicSourceUpdate(); if (appdata.settings['checkUpdateOnStart']) { - await Future.delayed(const Duration(milliseconds: 300)); - await checkUpdateUi(false); + await checkUpdateUi(false, true); } } diff --git a/lib/pages/settings/about.dart b/lib/pages/settings/about.dart index 6f8ae5d..a50b67c 100644 --- a/lib/pages/settings/about.dart +++ b/lib/pages/settings/about.dart @@ -96,10 +96,13 @@ Future checkUpdate() async { return false; } -Future checkUpdateUi([bool showMessageIfNoUpdate = true]) async { +Future checkUpdateUi([bool showMessageIfNoUpdate = true, bool delay = false]) async { try { var value = await checkUpdate(); if (value) { + if (delay) { + await Future.delayed(const Duration(seconds: 2)); + } showDialog( context: App.rootContext, builder: (context) {