Fix seed phrase restore

feature/default_network_editable
Dan Finlay 8 years ago
parent db356a181a
commit 498b30bddc
  1. 2
      app/scripts/keyring-controller.js
  2. 1
      ui/app/actions.js
  3. 6
      ui/app/keychains/hd/restore-vault.js

@ -82,7 +82,7 @@ module.exports = class KeyringController extends EventEmitter {
if (err) return cb(err) if (err) return cb(err)
this.addNewKeyring('HD Key Tree', { this.addNewKeyring('HD Key Tree', {
mnemonic: seed, mnemonic: seed,
n: 0, n: 1,
}, cb) }, cb)
}) })
} }

@ -195,7 +195,6 @@ function createNewVaultAndRestore (password, seed) {
background.createNewVaultAndRestore(password, seed, (err, newState) => { background.createNewVaultAndRestore(password, seed, (err, newState) => {
dispatch(actions.hideLoadingIndication()) dispatch(actions.hideLoadingIndication())
if (err) return dispatch(actions.displayWarning(err.message)) if (err) return dispatch(actions.displayWarning(err.message))
dispatch(this.updateMetamaskState(newState)) dispatch(this.updateMetamaskState(newState))
}) })
} }

@ -66,7 +66,7 @@ RestoreVaultScreen.prototype.render = function () {
type: 'password', type: 'password',
id: 'password-box-confirm', id: 'password-box-confirm',
placeholder: 'Confirm Password', placeholder: 'Confirm Password',
onKeyPress: this.onMaybeCreate.bind(this), onKeyPress: this.createOnEnter.bind(this),
dataset: { dataset: {
persistentFormId: 'password-confirmation', persistentFormId: 'password-confirmation',
}, },
@ -110,9 +110,9 @@ RestoreVaultScreen.prototype.showInitializeMenu = function () {
this.props.dispatch(actions.showInitializeMenu()) this.props.dispatch(actions.showInitializeMenu())
} }
RestoreVaultScreen.prototype.onMaybeCreate = function (event) { RestoreVaultScreen.prototype.createOnEnter = function (event) {
if (event.key === 'Enter') { if (event.key === 'Enter') {
this.restoreVault() this.createNewVaultAndRestore()
} }
} }

Loading…
Cancel
Save