Skip to content

Commit

Permalink
fixup! Handle error for Twake welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Jun 10, 2024
1 parent b93a184 commit 5d823d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/pages/bootstrap/tom_bootstrap_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -112,7 +110,6 @@ class TomBootstrapDialogState extends State<TomBootstrapDialog>
'TomBootstrapDialog::_initializeRecoveryKeyState(): no recovery existed then call bootstrap',
);
Navigator.of(context, rootNavigator: false).pop<bool>(false);
await BootstrapDialog(client: widget.client).show();
}
}
} else {
Expand Down Expand Up @@ -198,13 +195,12 @@ class TomBootstrapDialogState extends State<TomBootstrapDialog>
case UploadRecoveryKeyState.unlockError:
WidgetsBinding.instance.addPostFrameCallback((_) async {
Navigator.of(context, rootNavigator: false).pop<bool>(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<bool>(false);
Navigator.of(context, rootNavigator: false).pop<bool>();
});
break;
default:
Expand Down Expand Up @@ -337,7 +333,7 @@ class TomBootstrapDialogState extends State<TomBootstrapDialog>
break;
case BootstrapState.error:
WidgetsBinding.instance.addPostFrameCallback((_) {
Navigator.of(context, rootNavigator: false).pop<bool>(false);
Navigator.of(context, rootNavigator: false).pop<bool>();
});
break;
case BootstrapState.done:
Expand Down
5 changes: 5 additions & 0 deletions lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -424,6 +425,10 @@ class ChatListController extends State<ChatList>
if (result != null) {
setState(() {});
}

if (result == false) {
await BootstrapDialog(client: activeClient).show();
}
});

if (!mounted) return;
Expand Down

0 comments on commit 5d823d3

Please sign in to comment.