From a1cf6cc296de3b57e055d674ca94e4a0b2309969 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Wed, 31 Oct 2018 11:55:35 +0100 Subject: [PATCH] Fixed passphrase checkbox --- .../modals/passphrase/Passphrase/index.js | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/components/modals/passphrase/Passphrase/index.js b/src/components/modals/passphrase/Passphrase/index.js index 79137762..46f69841 100644 --- a/src/components/modals/passphrase/Passphrase/index.js +++ b/src/components/modals/passphrase/Passphrase/index.js @@ -161,24 +161,18 @@ class Passphrase extends PureComponent { } handleCheckboxClick() { - // If passphrase was visible and now shouldn't be --> delete the value of passphraseCheckInputValue - // doPassphraseInputsMatch - // - if passphrase was visible and now shouldn't be --> doPassphraseInputsMatch = false - // - because passphraseCheckInputValue will be empty string - // - if passphrase wasn't visibe and now should be --> doPassphraseInputsMatch = true - // - because passphraseCheckInputValue will be same as passphraseInputValue - let doInputsMatch = false; + let match = false; if (this.state.shouldShowSingleInput || this.state.passphraseInputValue === this.state.passphraseCheckInputValue) { - doInputsMatch = true; + match = true; } else { - doInputsMatch = !!this.state.isPassphraseHidden; + match = !!this.state.isPassphraseHidden; } this.setState(previousState => ({ isPassphraseHidden: !previousState.isPassphraseHidden, - passphraseInputValue: previousState.isPassphraseHidden ? previousState.passphraseInputValue : '', - passphraseCheckInputValue: previousState.isPassphraseHidden ? previousState.passphraseInputValue : '', - doPassphraseInputsMatch: doInputsMatch, + passphraseInputValue: previousState.passphraseInputValue, + passphraseCheckInputValue: previousState.passphraseCheckInputValue, + doPassphraseInputsMatch: match, })); } @@ -239,11 +233,9 @@ class Passphrase extends PureComponent { /> )} - {!this.state.doPassphraseInputsMatch && ( Passphrases do not match )} - { >Enter -