Fix then-catch + error handling in import-account

feature/default_network_editable
Dan 7 years ago
parent 1c3d2aa18b
commit 0f3480a97f
  1. 3
      ui/app/components/pages/create-account/import-account/json.js
  2. 3
      ui/app/components/pages/create-account/import-account/private-key.js

@ -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))
}
}

@ -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))
}

Loading…
Cancel
Save