This commit is contained in:
Matthew Fosse 2024-05-16 09:55:07 -07:00
parent 71245d7eb6
commit 49f45e0dea

View file

@ -122,10 +122,6 @@ class _WalletSeedPageBodyState extends State<WalletSeedPageBody> {
// required to setup autofill context: // required to setup autofill context:
_nameFieldController.text = widget.walletSeedViewModel.name; _nameFieldController.text = widget.walletSeedViewModel.name;
// WidgetsBinding.instance.addPostFrameCallback((_) async {
// setupPasswordManager();
// });
} }
Future<void> setupPasswordManager() async { Future<void> setupPasswordManager() async {
@ -134,7 +130,7 @@ class _WalletSeedPageBodyState extends State<WalletSeedPageBody> {
await Future.delayed(Duration(milliseconds: 200)); await Future.delayed(Duration(milliseconds: 200));
_seedFieldController.text = widget.walletSeedViewModel.seed; _seedFieldController.text = widget.walletSeedViewModel.seed;
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) async {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
}); });
} }
@ -267,7 +263,7 @@ class _WalletSeedPageBodyState extends State<WalletSeedPageBody> {
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
child: PrimaryButton( child: PrimaryButton(
onPressed: () async { onPressed: () async {
showPopUp<void>( bool open = await showPopUp<bool>(
context: context, context: context,
builder: (dialogContext) { builder: (dialogContext) {
return AlertWithTwoActions( return AlertWithTwoActions(
@ -275,14 +271,19 @@ class _WalletSeedPageBodyState extends State<WalletSeedPageBody> {
alertContent: S.of(context).save_backup_password, alertContent: S.of(context).save_backup_password,
rightButtonText: S.of(context).ok, rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel, leftButtonText: S.of(context).cancel,
actionRightButton: () async {}, actionRightButton: () async {
actionLeftButton: () => Navigator.of(dialogContext).pop(), Navigator.of(dialogContext).pop(true);
},
actionLeftButton: () => Navigator.of(dialogContext).pop(false),
); );
}, },
); ) ??
false;
if (open) {
await setupPasswordManager(); await setupPasswordManager();
TextInput.finishAutofillContext(); TextInput.finishAutofillContext();
}
}, },
text: S.current.save_to_pm, text: S.current.save_to_pm,
color: Colors.blue, color: Colors.blue,