aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 1a1904621..b5c51fd03 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -107,7 +107,6 @@ class KeyringController extends EventEmitter {
const firstAccount = accounts[0]
if (!firstAccount) throw new Error('KeyringController - First Account not found.')
const hexAccount = normalizeAddress(firstAccount)
- this.emit('newAccount', hexAccount)
return this.setupAccounts(accounts)
})
.then(this.persistAllKeyrings.bind(this, password))
@@ -207,6 +206,12 @@ class KeyringController extends EventEmitter {
// and then saves those changes.
addNewAccount (selectedKeyring) {
return selectedKeyring.addAccounts(1)
+ .then((accounts) => {
+ accounts.forEach((hexAccount) => {
+ this.emit('newAccount', hexAccount)
+ })
+ return accounts
+ })
.then(this.setupAccounts.bind(this))
.then(this.persistAllKeyrings.bind(this))
.then(this._updateMemStoreKeyrings.bind(this))
@@ -325,7 +330,6 @@ class KeyringController extends EventEmitter {
const firstAccount = accounts[0]
if (!firstAccount) throw new Error('KeyringController - No account found on keychain.')
const hexAccount = normalizeAddress(firstAccount)
- this.emit('newAccount', hexAccount)
this.emit('newVault', hexAccount)
return this.setupAccounts(accounts)
})