diff options
author | Dan <danjm.com@gmail.com> | 2018-06-01 02:09:24 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-06-01 02:09:24 +0800 |
commit | 701611e317d120d2c0530e4794bd498a74e233b2 (patch) | |
tree | 4ec098d593de7ff5fe20907a48c56061cc14de54 /ui/app/components/pages/unlock-page/unlock-page.component.js | |
parent | 1bde2892ec222cec1ba3265d50ed59f665afbf83 (diff) | |
parent | 2ca084b0557242b34733107701a14ba0724363b3 (diff) | |
download | tangerine-wallet-browser-701611e317d120d2c0530e4794bd498a74e233b2.tar.gz tangerine-wallet-browser-701611e317d120d2c0530e4794bd498a74e233b2.tar.zst tangerine-wallet-browser-701611e317d120d2c0530e4794bd498a74e233b2.zip |
Merge branch 'i3725-refactor-send-component-' into i3914-fix-newui-send-gas-estimation
Diffstat (limited to 'ui/app/components/pages/unlock-page/unlock-page.component.js')
-rw-r--r-- | ui/app/components/pages/unlock-page/unlock-page.component.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ui/app/components/pages/unlock-page/unlock-page.component.js b/ui/app/components/pages/unlock-page/unlock-page.component.js index a2f009d8f..8bc3897da 100644 --- a/ui/app/components/pages/unlock-page/unlock-page.component.js +++ b/ui/app/components/pages/unlock-page/unlock-page.component.js @@ -34,14 +34,7 @@ class UnlockPage extends Component { } } - tryUnlockMetamask (password) { - const { tryUnlockMetamask, history } = this.props - tryUnlockMetamask(password) - .then(() => history.push(DEFAULT_ROUTE)) - .catch(({ message }) => this.setState({ error: message })) - } - - handleSubmit (event) { + async handleSubmit (event) { event.preventDefault() event.stopPropagation() @@ -54,9 +47,14 @@ class UnlockPage extends Component { this.setState({ error: null }) - tryUnlockMetamask(password) - .then(() => history.push(DEFAULT_ROUTE)) - .catch(({ message }) => this.setState({ error: message })) + try { + await tryUnlockMetamask(password) + } catch ({ message }) { + this.setState({ error: message }) + return + } + + history.push(DEFAULT_ROUTE) } handleInputChange ({ target }) { |