Revert "Fix bug"

This reverts commit ef43116119.
This commit is contained in:
2024-06-02 13:59:45 +00:00
committed by GitHub
parent ef43116119
commit ca8fb15f0e
4 changed files with 12 additions and 4 deletions

View File

@@ -112,7 +112,9 @@ class _NewDownloadTaskPage extends State<NewDownloadTaskPage> {
Widget build(BuildContext context) {
tryInitApi(context);
if (_ok) {
context.canPop() ? context.pop() : context.go("/task_manager");
WidgetsBinding.instance!.addPostFrameCallback((_) {
context.canPop() ? context.pop() : context.go("/task_manager");
});
}
if (!_fetched) fetchDefaultCfg();
final i18n = AppLocalizations.of(context)!;

View File

@@ -96,7 +96,9 @@ class _NewExportZipTaskPage extends State<NewExportZipTaskPage> {
Widget build(BuildContext context) {
tryInitApi(context);
if (_ok) {
context.canPop() ? context.pop() : context.go("/task_manager");
WidgetsBinding.instance!.addPostFrameCallback((_) {
context.canPop() ? context.pop() : context.go("/task_manager");
});
}
if (!_fetched) fetchDefaultCfg();
final i18n = AppLocalizations.of(context)!;

View File

@@ -84,7 +84,9 @@ class _NewUserPage extends State<NewUserPage> {
return Container();
}
if (_newUserId != null) {
context.canPop() ? context.pop() : context.go("/users");
SchedulerBinding.instance.addPostFrameCallback((_) {
context.canPop() ? context.pop() : context.go("/users");
});
return Container();
}
final i18n = AppLocalizations.of(context)!;

View File

@@ -121,7 +121,9 @@ class _LoginPageState extends State<LoginPage>
tryInitApi(context);
_checkStatus(context);
if (isTop(context) && auth.user != null) {
context.canPop() ? context.pop() : context.go("/");
SchedulerBinding.instance.addPostFrameCallback((_) {
context.canPop() ? context.pop() : context.go("/");
});
}
return Scaffold(
appBar: AppBar(