Browse Source

Wallet login - fix seed type bug

all-modes
petitPapillon 7 years ago
parent
commit
65494843c6
  1. 15
      react/src/components/login/login.js
  2. 4
      react/src/components/login/login.render.js

15
react/src/components/login/login.js

@ -38,7 +38,8 @@ class Login extends React.Component {
isCustomSeedWeak: false,
};
this.toggleActivateCoinForm = this.toggleActivateCoinForm.bind(this);
this.updateInput = this.updateInput.bind(this);
this.updateRegisterConfirmPassPhraseInput = this.updateRegisterConfirmPassPhraseInput.bind(this);
this.updateLoginPassPhraseInput = this.updateLoginPassPhraseInput.bind(this);
this.loginSeed = this.loginSeed.bind(this);
this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
this.handleRegisterWallet = this.handleRegisterWallet.bind(this);
@ -151,15 +152,21 @@ class Login extends React.Component {
Store.dispatch(toggleAddcoinModal(true, false));
}
updateInput(e) {
updateLoginPassPhraseInput(e) {
this.setState({
[e.target.name]: e.target.value,
isSeedConfirmError: false,
isSeedBlank: this.isBlank(e.target.value),
loginPassPhraseSeedType: this.getLoginPassPhraseSeedType(e.target.value)
});
}
updateRegisterConfirmPassPhraseInput(e) {
this.setState({
[e.target.name]: e.target.value,
isSeedConfirmError: false,
isSeedBlank: this.isBlank(e.target.value)
});
}
updateWalletSeed(e) {
this.setState({
randomSeed: e.target.value,

4
react/src/components/login/login.render.js

@ -61,7 +61,7 @@ const LoginRender = function () {
type={ this.state.seedInputVisibility ? 'text' : 'password' }
className="form-control"
name="loginPassphrase"
onChange={ this.updateInput }
onChange={ this.updateLoginPassPhraseInput }
onKeyDown={ (event) => this.handleKeydown(event) }/>
<i
className={ !this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye' }
@ -215,7 +215,7 @@ const LoginRender = function () {
type="text"
name="randomSeedConfirm"
value={ this.state.randomSeedConfirm }
onChange={ this.updateInput }
onChange={ this.updateRegisterConfirmPassPhraseInput }
id="rwalletseed"></textarea>
<span className={ this.state.isSeedBlank ? 'help-block' : 'hide' }>
{ translate('LOGIN.MUST_ENTER_SEED') }.

Loading…
Cancel
Save