diff --git a/lib/src/screens/restore/restore_wallet_from_seed_page.dart b/lib/src/screens/restore/restore_wallet_from_seed_page.dart index 44ec2f890..024e8d848 100644 --- a/lib/src/screens/restore/restore_wallet_from_seed_page.dart +++ b/lib/src/screens/restore/restore_wallet_from_seed_page.dart @@ -62,10 +62,16 @@ class _RestoreFromSeedFormState extends State { alignment: Alignment.bottomCenter, child: PrimaryButton( onPressed: () { + walletRestorationStore.validateSeed(_seedKey.currentState.items); + _seedKey.currentState.setErrorMessage(walletRestorationStore.errorMessage); + if (!walletRestorationStore.isValid) { + _seedKey.currentState.invalidate(); return; } + _seedKey.currentState.validated(); + Navigator.of(context).pushNamed( Routes.restoreWalletFromSeedDetails, arguments: _seedKey.currentState.items); diff --git a/lib/src/stores/wallet_restoration/wallet_restoration_store.dart b/lib/src/stores/wallet_restoration/wallet_restoration_store.dart index 968e14b85..aa98ffc36 100644 --- a/lib/src/stores/wallet_restoration/wallet_restoration_store.dart +++ b/lib/src/stores/wallet_restoration/wallet_restoration_store.dart @@ -76,13 +76,12 @@ abstract class WalleRestorationStoreBase with Store { @action void setSeed(List seed) { this.seed = seed; - validateSeed(seed); } @action void validateSeed(List seed) { final _seed = seed != null ? seed : this.seed; - bool isValid = _seed.length == 25; + bool isValid = _seed != null ? _seed.length == 25 : false; if (!isValid) { errorMessage = S.current.wallet_restoration_store_incorrect_seed_length;