From 0a7b388b39d86039e4e4cf5df8dfe5104e7b6137 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 4 Apr 2017 18:38:56 +0200 Subject: Fix faucet to only autoFaucet first account --- app/scripts/keyring-controller.js | 1 + app/scripts/metamask-controller.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 72f613641..16df6efa6 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -324,6 +324,7 @@ class KeyringController extends EventEmitter { 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) }) .then(this.persistAllKeyrings.bind(this)) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index af8b4688d..5f71fc369 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -79,6 +79,8 @@ module.exports = class MetamaskController extends EventEmitter { }) this.keyringController.on('newAccount', (address) => { this.preferencesController.setSelectedAddress(address) + }) + this.keyringController.on('newVault', (address) => { autoFaucet(address) }) -- cgit v1.2.3