Add fix for infinite spinner for incorrect seed phrase.

feature/default_network_editable
Kevin Serrano 7 years ago
parent b2e4f913ba
commit 20aa135ad8
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
  1. 13
      app/scripts/metamask-controller.js
  2. 4
      ui/app/keychains/hd/restore-vault.js

@ -513,10 +513,15 @@ module.exports = class MetamaskController extends EventEmitter {
async createNewVaultAndRestore (password, seed) { async createNewVaultAndRestore (password, seed) {
const release = await this.createVaultMutex.acquire() const release = await this.createVaultMutex.acquire()
const vault = await this.keyringController.createNewVaultAndRestore(password, seed) try {
this.selectFirstIdentity(vault) const vault = await this.keyringController.createNewVaultAndRestore(password, seed)
release() this.selectFirstIdentity(vault)
return vault release()
return vault
} catch (err) {
release()
throw err
}
} }
selectFirstIdentity (vault) { selectFirstIdentity (vault) {

@ -149,4 +149,8 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () {
this.warning = null this.warning = null
this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.displayWarning(this.warning))
this.props.dispatch(actions.createNewVaultAndRestore(password, seed)) this.props.dispatch(actions.createNewVaultAndRestore(password, seed))
.catch((err) => {
log.error(err.message)
})
} }

Loading…
Cancel
Save