diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-12 12:34:08 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-12 12:35:05 +0800 |
commit | f41830b7983a81472ce49eabce02ef4b951cc458 (patch) | |
tree | 7c60ad9ca5d887247e42446ef52ee1b2d6721a98 /ui/app/components/pages | |
parent | 140fcb4bf1c7654463b3144b9d8a9b4786b3034c (diff) | |
download | tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.tar tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.tar.gz tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.tar.bz2 tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.tar.lz tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.tar.xz tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.tar.zst tangerine-wallet-browser-f41830b7983a81472ce49eabce02ef4b951cc458.zip |
Trim whitespace from seed phrase during import
Somehow we lost 33b85cf2e
Diffstat (limited to 'ui/app/components/pages')
-rw-r--r-- | ui/app/components/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/components/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/components/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index 8d81e5d8e..6f8ab031a 100644 --- a/ui/app/components/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/components/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -30,6 +30,7 @@ export default class ImportWithSeedPhrase extends PureComponent { parseSeedPhrase = (seedPhrase) => { return seedPhrase + .trim() .match(/\w+/g) .join(' ') } @@ -38,9 +39,10 @@ export default class ImportWithSeedPhrase extends PureComponent { let seedPhraseError = '' 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') } } |