aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-11-27 00:40:42 +0800
committerGitHub <noreply@github.com>2018-11-27 00:40:42 +0800
commit33b85cf2e482251ac266468adc2845cd8efa7f10 (patch)
treed39e11f20f0ead3abe7e8d8ccac74c11cad705b4
parenteec7fcebd528a70b5c8a3571c5b802ced889e626 (diff)
downloadtangerine-wallet-browser-33b85cf2e482251ac266468adc2845cd8efa7f10.tar.gz
tangerine-wallet-browser-33b85cf2e482251ac266468adc2845cd8efa7f10.tar.zst
tangerine-wallet-browser-33b85cf2e482251ac266468adc2845cd8efa7f10.zip
Trim whitespace from seed phrase during import (#5827)
-rw-r--r--mascara/src/app/first-time/import-seed-phrase-screen.js6
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')
}
}