clear errors of previous failed login attempts (#7516)

When the first login attempt is failed(due to incorrect secretkey)
and the next attempt is successful. Error message shown for
the previous attempts should go away.

Fixes #7514
master
Kanagaraj M 6 years ago committed by Nitish Tiwari
parent d2f42d830f
commit 3efcd6fa46
  1. 10
      browser/app/js/browser/Login.js
  2. 63
      browser/ui-assets.go

@ -48,7 +48,7 @@ export class Login extends React.Component {
handleSubmit(event) {
event.preventDefault()
const { showAlert, history } = this.props
const { showAlert, clearAlert, history } = this.props
let message = ""
if (this.state.accessKey === "") {
message = "Access Key cannot be empty"
@ -66,6 +66,9 @@ export class Login extends React.Component {
password: this.state.secretKey
})
.then(res => {
// Clear alerts from previous login attempts
clearAlert()
history.push("/")
})
.catch(e => {
@ -145,4 +148,7 @@ const mapDispatchToProps = dispatch => {
}
}
export default connect(state => state, mapDispatchToProps)(Login)
export default connect(
state => state,
mapDispatchToProps
)(Login)

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save