mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Fix setTimeout
This commit is contained in:
@@ -172,6 +172,12 @@ class JsEngine with _JSEngineApi {
|
||||
{
|
||||
return ComicSource.find(message["key"])!.isLogged;
|
||||
}
|
||||
// temporary solution for [setTimeout] function
|
||||
// TODO: implement [setTimeout] in quickjs project
|
||||
case "delay":
|
||||
{
|
||||
return Future.delayed(Duration(milliseconds: message["time"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@@ -8,6 +8,7 @@ import 'package:venera/foundation/comic_source/comic_source.dart';
|
||||
import 'package:venera/foundation/log.dart';
|
||||
import 'package:venera/network/app_dio.dart';
|
||||
import 'package:venera/utils/ext.dart';
|
||||
import 'package:venera/utils/image.dart';
|
||||
import 'package:venera/utils/io.dart';
|
||||
import 'package:venera/utils/translations.dart';
|
||||
|
||||
@@ -705,10 +706,14 @@ class _CallbackSettingState extends State<_CallbackSetting> {
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
});
|
||||
await result;
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
try {
|
||||
await result;
|
||||
}
|
||||
finally {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user