mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix error handling on incorrect password (#4401)
This commit is contained in:
parent
f5fb06020d
commit
d40971e7f3
@ -34,14 +34,7 @@ class UnlockPage extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
tryUnlockMetamask (password) {
|
||||
const { tryUnlockMetamask, history } = this.props
|
||||
tryUnlockMetamask(password)
|
||||
.catch(({ message }) => this.setState({ error: message }))
|
||||
.then(() => history.push(DEFAULT_ROUTE))
|
||||
}
|
||||
|
||||
handleSubmit (event) {
|
||||
async handleSubmit (event) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
@ -54,9 +47,14 @@ class UnlockPage extends Component {
|
||||
|
||||
this.setState({ error: null })
|
||||
|
||||
tryUnlockMetamask(password)
|
||||
.catch(({ message }) => this.setState({ error: message }))
|
||||
.then(() => history.push(DEFAULT_ROUTE))
|
||||
try {
|
||||
await tryUnlockMetamask(password)
|
||||
} catch ({ message }) {
|
||||
this.setState({ error: message })
|
||||
return
|
||||
}
|
||||
|
||||
history.push(DEFAULT_ROUTE)
|
||||
}
|
||||
|
||||
handleInputChange ({ target }) {
|
||||
|
Loading…
Reference in New Issue
Block a user