fix: Missing null check and bootstrap ask
This commit is contained in:
parent
597e723515
commit
21801318eb
4 changed files with 31 additions and 2 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/flutter_matrix_hive_database.dart';
|
||||
import 'package:matrix/encryption.dart';
|
||||
import 'package:matrix/encryption/utils/bootstrap.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
|
@ -65,6 +67,12 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
});
|
||||
}
|
||||
|
||||
void cancelAndDontAskAgain() async {
|
||||
await (widget.client.database as FlutterMatrixHiveStore)
|
||||
.put(SettingKeys.dontAskForBootstrapKey, true);
|
||||
Navigator.of(context, rootNavigator: false).pop<bool>(false);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_wipe ??= widget.wipe;
|
||||
|
|
@ -81,6 +89,11 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
label: L10n.of(context).next,
|
||||
onPressed: () => _createBootstrap(false),
|
||||
));
|
||||
buttons.add(AdaptiveFlatButton(
|
||||
label: L10n.of(context).dontAskAgain,
|
||||
onPressed: cancelAndDontAskAgain,
|
||||
textColor: Colors.red,
|
||||
));
|
||||
} else if (bootstrap.newSsssKey?.recoveryKey != null &&
|
||||
_recoveryKeyStored == false) {
|
||||
final key = bootstrap.newSsssKey.recoveryKey;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue