fix config update issue

This commit is contained in:
2024-11-15 17:03:28 +08:00
parent 65b41b2873
commit edff9c7a0c
2 changed files with 8 additions and 6 deletions

View File

@@ -157,9 +157,11 @@ class ComicSourceParser {
await source.loadData();
if(_checkExists("init")) {
Future.delayed(const Duration(milliseconds: 50), () {
JsEngine().runCode("ComicSource.sources.$_key.init()");
});
}
return source;
}

View File

@@ -55,10 +55,10 @@ class ComicSourcePage extends StatefulWidget {
title: "Updates Available".tl,
content: msg,
confirmText: "Update",
onConfirm: () {
onConfirm: () async {
for (var key in shouldUpdate) {
var source = ComicSource.find(key);
_BodyState.update(source!);
await _BodyState.update(source!);
}
},
);
@@ -277,7 +277,7 @@ class _BodyState extends State<_Body> {
}
}
static void update(ComicSource source) async {
static Future<void> update(ComicSource source) async {
if (!source.url.isURL) {
App.rootContext.showMessage(message: "Invalid url config");
return;