Skip to content

Commit

Permalink
seed import file disallow custom seed if hd wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
naezith committed Jan 13, 2025
1 parent c916471 commit 61afa86
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/views/wallets_manager/widgets/wallet_import_by_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,15 @@ class _WalletImportByFileState extends State<WalletImportByFile> {
},
),
const SizedBox(height: 15),
CustomSeedCheckbox(
value: _allowCustomSeed,
onChanged: (value) {
setState(() {
_allowCustomSeed = value;
});
},
),
if (!_isHdMode)
CustomSeedCheckbox(
value: _allowCustomSeed,
onChanged: (value) {
setState(() {
_allowCustomSeed = value;
});
},
),
const SizedBox(height: 15),
EulaTosCheckboxes(
key: const Key('import-wallet-eula-checks'),
Expand Down Expand Up @@ -207,7 +208,8 @@ class _WalletImportByFileState extends State<WalletImportByFile> {
if (decryptedSeed == null) return;
if (!_isValidData) return;

if (!_allowCustomSeed && !bip39.validateMnemonic(decryptedSeed)) {
if ((_isHdMode || !_allowCustomSeed) &&
!bip39.validateMnemonic(decryptedSeed)) {
setState(() {
_commonError = LocaleKeys.walletCreationBip39SeedError.tr();
});
Expand Down

0 comments on commit 61afa86

Please sign in to comment.