From 5d823d39778118ad017258b2260b54025fc4e787 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Mon, 10 Jun 2024 10:47:22 +0700 Subject: [PATCH] fixup! Handle error for Twake welcome screen --- lib/pages/bootstrap/tom_bootstrap_dialog.dart | 8 ++------ lib/pages/chat_list/chat_list.dart | 5 +++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pages/bootstrap/tom_bootstrap_dialog.dart b/lib/pages/bootstrap/tom_bootstrap_dialog.dart index d66f994a66..3ae3a9d612 100644 --- a/lib/pages/bootstrap/tom_bootstrap_dialog.dart +++ b/lib/pages/bootstrap/tom_bootstrap_dialog.dart @@ -14,8 +14,6 @@ import 'package:matrix/encryption.dart'; import 'package:matrix/encryption/utils/bootstrap.dart'; import 'package:matrix/matrix.dart'; -import 'bootstrap_dialog.dart'; - class TomBootstrapDialog extends StatefulWidget { final Client client; @@ -112,7 +110,6 @@ class TomBootstrapDialogState extends State 'TomBootstrapDialog::_initializeRecoveryKeyState(): no recovery existed then call bootstrap', ); Navigator.of(context, rootNavigator: false).pop(false); - await BootstrapDialog(client: widget.client).show(); } } } else { @@ -198,13 +195,12 @@ class TomBootstrapDialogState extends State case UploadRecoveryKeyState.unlockError: WidgetsBinding.instance.addPostFrameCallback((_) async { Navigator.of(context, rootNavigator: false).pop(false); - await BootstrapDialog(client: widget.client).show(); }); break; case UploadRecoveryKeyState.uploadError: Logs().e('TomBootstrapDialogState::build(): upload recovery key error'); WidgetsBinding.instance.addPostFrameCallback((_) { - Navigator.of(context, rootNavigator: false).pop(false); + Navigator.of(context, rootNavigator: false).pop(); }); break; default: @@ -337,7 +333,7 @@ class TomBootstrapDialogState extends State break; case BootstrapState.error: WidgetsBinding.instance.addPostFrameCallback((_) { - Navigator.of(context, rootNavigator: false).pop(false); + Navigator.of(context, rootNavigator: false).pop(); }); break; case BootstrapState.done: diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 46b1f4eb13..121c797303 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -7,6 +7,7 @@ import 'package:fluffychat/config/first_column_inner_routes.dart'; import 'package:fluffychat/di/global/dio_cache_interceptor_for_client.dart'; import 'package:fluffychat/di/global/get_it_initializer.dart'; import 'package:fluffychat/domain/model/room/room_extension.dart'; +import 'package:fluffychat/pages/bootstrap/bootstrap_dialog.dart'; import 'package:fluffychat/presentation/mixins/comparable_presentation_contact_mixin.dart'; import 'package:fluffychat/pages/bootstrap/tom_bootstrap_dialog.dart'; import 'package:fluffychat/pages/chat_list/chat_list_view.dart'; @@ -424,6 +425,10 @@ class ChatListController extends State if (result != null) { setState(() {}); } + + if (result == false) { + await BootstrapDialog(client: activeClient).show(); + } }); if (!mounted) return;