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

Fix seed phrase restore

This commit is contained in:
Dan Finlay 2016-11-01 11:51:51 -07:00
parent db356a181a
commit 498b30bddc
3 changed files with 4 additions and 5 deletions

View File

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

View File

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

View File

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