aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-02-12 22:33:43 +0800
committerGitHub <noreply@github.com>2019-02-12 22:33:43 +0800
commitcbb34b3726c4f5d5814f31a022a891b278c52be6 (patch)
treeb344f197f1ed87beaade21695b2be996a9236db4
parent7f9d8de4ce6bad31a1a59b4afeb7bc0528b29433 (diff)
parentf41830b7983a81472ce49eabce02ef4b951cc458 (diff)
downloadtangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.tar
tangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.tar.gz
tangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.tar.bz2
tangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.tar.lz
tangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.tar.xz
tangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.tar.zst
tangerine-wallet-browser-cbb34b3726c4f5d5814f31a022a891b278c52be6.zip
Merge pull request #6134 from whymarrh/first-time-seed-whitespace
Trim whitespace from seed phrase during import
-rw-r--r--ui/app/components/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js6
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')
}
}