1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +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) 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)
}) })
} }

View File

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

View File

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