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:
parent
de88a49243
commit
8049c1fc07
@ -423,11 +423,9 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
createFirstKeyTree () {
|
createFirstKeyTree () {
|
||||||
this.clearKeyrings()
|
this.clearKeyrings()
|
||||||
return this.addNewKeyring('HD Key Tree', {numberOfAccounts: 1})
|
return this.addNewKeyring('HD Key Tree', {numberOfAccounts: 1})
|
||||||
.then(() => {
|
.then((keyring) => {
|
||||||
return this.keyrings[0].getAccounts()
|
const firstAccount = keyring.getAccounts()[0]
|
||||||
})
|
if (!firstAccount) throw new Error('KeyringController - No account found on keychain.')
|
||||||
.then((accounts) => {
|
|
||||||
const firstAccount = accounts[0]
|
|
||||||
const hexAccount = normalize(firstAccount)
|
const hexAccount = normalize(firstAccount)
|
||||||
this.configManager.setSelectedAccount(hexAccount)
|
this.configManager.setSelectedAccount(hexAccount)
|
||||||
this.emit('newAccount', hexAccount)
|
this.emit('newAccount', hexAccount)
|
||||||
|
Loading…
Reference in New Issue
Block a user