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

keyring-controller - cleanup

This commit is contained in:
kumavis 2017-01-24 13:22:26 -08:00
parent 8049c1fc07
commit 01c88bb0bd

View File

@ -422,9 +422,10 @@ module.exports = class KeyringController extends EventEmitter {
// puts the current seed words into the state tree.
createFirstKeyTree () {
this.clearKeyrings()
return this.addNewKeyring('HD Key Tree', {numberOfAccounts: 1})
return this.addNewKeyring('HD Key Tree', { numberOfAccounts: 1 })
.then((keyring) => {
const firstAccount = keyring.getAccounts()[0]
const accounts = keyring.getAccounts()
const firstAccount = accounts[0]
if (!firstAccount) throw new Error('KeyringController - No account found on keychain.')
const hexAccount = normalize(firstAccount)
this.configManager.setSelectedAccount(hexAccount)