diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-11-27 00:40:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 00:40:42 +0800 |
commit | 33b85cf2e482251ac266468adc2845cd8efa7f10 (patch) | |
tree | d39e11f20f0ead3abe7e8d8ccac74c11cad705b4 /mascara | |
parent | eec7fcebd528a70b5c8a3571c5b802ced889e626 (diff) | |
download | tangerine-wallet-browser-33b85cf2e482251ac266468adc2845cd8efa7f10.tar.gz tangerine-wallet-browser-33b85cf2e482251ac266468adc2845cd8efa7f10.tar.zst tangerine-wallet-browser-33b85cf2e482251ac266468adc2845cd8efa7f10.zip |
Trim whitespace from seed phrase during import (#5827)
Diffstat (limited to 'mascara')
-rw-r--r-- | mascara/src/app/first-time/import-seed-phrase-screen.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mascara/src/app/first-time/import-seed-phrase-screen.js b/mascara/src/app/first-time/import-seed-phrase-screen.js index 883893e88..764e9ed4c 100644 --- a/mascara/src/app/first-time/import-seed-phrase-screen.js +++ b/mascara/src/app/first-time/import-seed-phrase-screen.js @@ -33,6 +33,7 @@ class ImportSeedPhraseScreen extends Component { parseSeedPhrase = (seedPhrase) => { return seedPhrase + .trim() .match(/\w+/g) .join(' ') } @@ -41,9 +42,10 @@ class ImportSeedPhraseScreen extends Component { let seedPhraseError = null if (seedPhrase) { - if (this.parseSeedPhrase(seedPhrase).split(' ').length !== 12) { + const parsedSeedPhrase = this.parseSeedPhrase(seedPhrase) + if (parsedSeedPhrase.split(' ').length !== 12) { seedPhraseError = this.context.t('seedPhraseReq') - } else if (!validateMnemonic(seedPhrase)) { + } else if (!validateMnemonic(parsedSeedPhrase)) { seedPhraseError = this.context.t('invalidSeedPhrase') } } |