Skip to content

Commit

Permalink
Merge pull request #843 from threefoldtech/development_stellar_secret
Browse files Browse the repository at this point in the history
fix adding existing stellar secret
  • Loading branch information
AlaaElattar authored Jan 19, 2025
2 parents 640ee19 + 0a90ec9 commit 6f79360
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/lib/widgets/wallets/add_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ class _NewWalletState extends ConsumerState<NewWallet> {
return false;
}

if (walletSecret.startsWith('S') && widget.wallets.any((wallet) => wallet.stellarSecret == walletSecret)){
secretError = 'Secret already exists';
return false;
}

if (isValidStellarSecret(walletSecret)) {
return true;
}
Expand All @@ -147,6 +152,10 @@ class _NewWalletState extends ConsumerState<NewWallet> {
secretError = 'Invalid seed';
return false;
}
if (widget.wallets.any((wallet) => wallet.tfchainSecret == walletSecret)){
secretError = 'Secret already exists';
return false;
}
if (!walletSecret.startsWith('0x') && walletSecret.length != 64) {
secretError = 'Invalid seed length';
return false;
Expand Down

0 comments on commit 6f79360

Please sign in to comment.