diff --git a/lib/src/screens/restore/wallet_restore_from_seed_form.dart b/lib/src/screens/restore/wallet_restore_from_seed_form.dart index 4d1e3e7fb..9e3b084f0 100644 --- a/lib/src/screens/restore/wallet_restore_from_seed_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_seed_form.dart @@ -19,6 +19,7 @@ class WalletRestoreFromSeedForm extends StatefulWidget { WalletRestoreFromSeedForm({Key? key, required this.displayLanguageSelector, required this.displayBlockHeightSelector, + required this.displayPassphrase, required this.type, required this.displayWalletPassword, required this.seedSettingsViewModel, @@ -34,6 +35,7 @@ class WalletRestoreFromSeedForm extends StatefulWidget { final bool displayLanguageSelector; final bool displayBlockHeightSelector; final bool displayWalletPassword; + final bool displayPassphrase; final SeedSettingsViewModel seedSettingsViewModel; final FocusNode? blockHeightFocusNode; final Function(bool)? onHeightOrDateEntered; @@ -58,7 +60,8 @@ class WalletRestoreFromSeedFormState extends State { repeatedPasswordTextEditingController = displayWalletPassword ? TextEditingController() : null, - seedTypeController = TextEditingController(); + passphraseController = TextEditingController(), + seedTypeController = TextEditingController(); final GlobalKey seedWidgetStateKey; final GlobalKey blockchainHeightKey; @@ -67,6 +70,7 @@ class WalletRestoreFromSeedFormState extends State { final TextEditingController? passwordTextEditingController; final TextEditingController? repeatedPasswordTextEditingController; final TextEditingController seedTypeController; + final TextEditingController passphraseController; final GlobalKey formKey; late ReactionDisposer moneroSeedTypeReaction; String language; diff --git a/lib/src/screens/restore/wallet_restore_page.dart b/lib/src/screens/restore/wallet_restore_page.dart index 6215e26c3..3a80dbe2e 100644 --- a/lib/src/screens/restore/wallet_restore_page.dart +++ b/lib/src/screens/restore/wallet_restore_page.dart @@ -37,6 +37,7 @@ class WalletRestorePage extends BasePage { displayBlockHeightSelector: walletRestoreViewModel.hasBlockchainHeightLanguageSelector, displayLanguageSelector: walletRestoreViewModel.hasSeedLanguageSelector, + displayPassphrase: walletRestoreViewModel.hasPassphrase, type: walletRestoreViewModel.type, key: walletRestoreFromSeedFormKey, blockHeightFocusNode: _blockHeightFocusNode, diff --git a/lib/view_model/restore/restore_from_qr_vm.dart b/lib/view_model/restore/restore_from_qr_vm.dart index d5a408da0..43233ad2a 100644 --- a/lib/view_model/restore/restore_from_qr_vm.dart +++ b/lib/view_model/restore/restore_from_qr_vm.dart @@ -109,7 +109,7 @@ abstract class WalletRestorationFromQRVMBase extends WalletCreationVM with Store height: restoreWallet.height ?? 0, mnemonic: restoreWallet.mnemonicSeed ?? '', password: password, - passphrase: passphrase ?? '', + passphrase: restoreWallet.passphrase ?? '', ); case WalletType.bitcoin: case WalletType.litecoin: @@ -173,7 +173,7 @@ abstract class WalletRestorationFromQRVMBase extends WalletCreationVM with Store height: restoreWallet.height ?? 0, mnemonic: restoreWallet.mnemonicSeed ?? '', password: password, - passphrase: passphrase ?? '', + passphrase: restoreWallet.passphrase ?? '', ); default: throw Exception('Unexpected type: ${type.toString()}'); diff --git a/lib/view_model/restore/restore_wallet.dart b/lib/view_model/restore/restore_wallet.dart index 20dbfb8cf..2c2a25005 100644 --- a/lib/view_model/restore/restore_wallet.dart +++ b/lib/view_model/restore/restore_wallet.dart @@ -15,8 +15,7 @@ class RestoredWallet { this.txDescription, this.recipientName, this.height, - this.privateKey, - this.passphrase}); + this.privateKey}); final WalletRestoreMode restoreMode; final WalletType type; @@ -31,7 +30,6 @@ class RestoredWallet { final String? recipientName; final int? height; final String? privateKey; - final String? passphrase; factory RestoredWallet.fromKey(Map json) { final height = json['height'] as String?; @@ -58,7 +56,6 @@ class RestoredWallet { mnemonicSeed: mnemonic_seed ?? seed, passphrase: passphrase, height: height != null ? int.parse(height) : 0, - passphrase: passphrase ); } diff --git a/lib/view_model/wallet_new_vm.dart b/lib/view_model/wallet_new_vm.dart index be30811d9..40912185f 100644 --- a/lib/view_model/wallet_new_vm.dart +++ b/lib/view_model/wallet_new_vm.dart @@ -152,7 +152,7 @@ abstract class WalletNewVMBase extends WalletCreationVM with Store { case WalletType.wownero: return wownero!.createWowneroNewWalletCredentials( name: name, - password: walletPassword, + password: walletPassword!, language: options!.first as String, isPolyseed: options.last as bool, );