1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix then-catch + error handling in import-account

This commit is contained in:
Dan 2018-05-30 21:33:40 -02:30
parent 1c3d2aa18b
commit 0f3480a97f
2 changed files with 2 additions and 4 deletions

View File

@ -106,8 +106,6 @@ class JsonImportSubview extends Component {
}
importNewJsonAccount([ fileContents, password ])
// JS runtime requires caught rejections but failures are handled by Redux
.catch()
.then(({ selectedAddress }) => {
if (selectedAddress) {
history.push(DEFAULT_ROUTE)
@ -116,6 +114,7 @@ class JsonImportSubview extends Component {
setSelectedAddress(firstAddress)
}
})
.catch(err => displayWarning(err))
}
}

View File

@ -96,8 +96,6 @@ PrivateKeyImportView.prototype.createNewKeychain = function () {
const { importNewAccount, history, displayWarning, setSelectedAddress, firstAddress } = this.props
importNewAccount('Private Key', [ privateKey ])
// JS runtime requires caught rejections but failures are handled by Redux
.catch()
.then(({ selectedAddress }) => {
if (selectedAddress) {
history.push(DEFAULT_ROUTE)
@ -106,4 +104,5 @@ PrivateKeyImportView.prototype.createNewKeychain = function () {
setSelectedAddress(firstAddress)
}
})
.catch(err => displayWarning(err))
}