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) {
|
async handleSubmit (event) {
|
||||||
const { tryUnlockMetamask, history } = this.props
|
|
||||||
tryUnlockMetamask(password)
|
|
||||||
.catch(({ message }) => this.setState({ error: message }))
|
|
||||||
.then(() => history.push(DEFAULT_ROUTE))
|
|
||||||
}
|
|
||||||
|
|
||||||
handleSubmit (event) {
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
|
||||||
@ -54,9 +47,14 @@ class UnlockPage extends Component {
|
|||||||
|
|
||||||
this.setState({ error: null })
|
this.setState({ error: null })
|
||||||
|
|
||||||
tryUnlockMetamask(password)
|
try {
|
||||||
.catch(({ message }) => this.setState({ error: message }))
|
await tryUnlockMetamask(password)
|
||||||
.then(() => history.push(DEFAULT_ROUTE))
|
} catch ({ message }) {
|
||||||
|
this.setState({ error: message })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
history.push(DEFAULT_ROUTE)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleInputChange ({ target }) {
|
handleInputChange ({ target }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user