Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

fix: make sure default page loaded when auto update (#1734)

Predidit803cdd586008
diff --git a/lib/pages/init_page.dart b/lib/pages/init_page.dart
index bed69b9a..1653b093 100644
--- a/lib/pages/init_page.dart
+++ b/lib/pages/init_page.dart
@@ -57,6 +57,8 @@ class _InitPageState extends State<InitPage> {
await _pluginInit();
_startDefaultPage();
+ // delay to ensure that the default page is fully loaded
+ await Future.delayed(const Duration(milliseconds: 500));
_update();
}
@@ -302,14 +304,9 @@ class _InitPageState extends State<InitPage> {
}
Future<void> _update() async {
- // Don't check update when there is no plugin.
- // We will progress init workflow instead.
- if (pluginsController.pluginList.isNotEmpty) {
- bool autoUpdate =
- setting.get(SettingBoxKey.autoUpdate, defaultValue: true);
- if (autoUpdate) {
- Modular.get<MyController>().checkUpdate(type: 'auto');
- }
+ bool autoUpdate = await setting.get(SettingBoxKey.autoUpdate, defaultValue: true);
+ if (autoUpdate) {
+ Modular.get<MyController>().checkUpdate(type: 'auto');
}
}