diff --git a/app/components/Views/Login/index.js b/app/components/Views/Login/index.js index a63189a4b70..279d75d6252 100644 --- a/app/components/Views/Login/index.js +++ b/app/components/Views/Login/index.js @@ -185,7 +185,9 @@ class Login extends PureComponent { this.mounted = false; } - onLogin = async locked => { + onLogin = async () => { + const { password } = this.state; + const locked = !passwordRequirementsMet(password); if (locked) this.setState({ error: strings('login.invalid_password') }); if (this.state.loading || locked) return; try { @@ -332,85 +334,80 @@ class Login extends PureComponent { return true; }; - render = () => { - const { password } = this.state; - const locked = !passwordRequirementsMet(password); - - return ( - - - - - {Device.isAndroid() ? ( - ( + + + + + {Device.isAndroid() ? ( + + ) : ( + + )} + + {strings('login.title')} + + {strings('login.password')} + ( + - {strings('login.title')} - - {strings('login.password')} - this.onLogin(locked)} - renderRightAccessory={() => ( - + /> + - {this.renderSwitch()} + {this.renderSwitch()} - {!!this.state.error && ( - - {this.state.error} - - )} + {!!this.state.error && ( + + {this.state.error} + + )} - - this.onLogin(locked)}> - {this.state.loading ? ( - - ) : ( - strings('login.login_button') - )} - - + + + {this.state.loading ? ( + + ) : ( + strings('login.login_button') + )} + + - - - + + - - - - ); - }; + + + + + ); } const mapStateToProps = state => ({