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

Merge pull request #1308 from MetaMask/FixFaucet

Fix faucet to only autoFaucet first account
This commit is contained in:
Kevin Serrano 2017-04-04 09:43:25 -07:00 committed by GitHub
commit 39181ed33f
2 changed files with 3 additions and 0 deletions

View File

@ -324,6 +324,7 @@ class KeyringController extends EventEmitter {
if (!firstAccount) throw new Error('KeyringController - No account found on keychain.') if (!firstAccount) throw new Error('KeyringController - No account found on keychain.')
const hexAccount = normalizeAddress(firstAccount) const hexAccount = normalizeAddress(firstAccount)
this.emit('newAccount', hexAccount) this.emit('newAccount', hexAccount)
this.emit('newVault', hexAccount)
return this.setupAccounts(accounts) return this.setupAccounts(accounts)
}) })
.then(this.persistAllKeyrings.bind(this)) .then(this.persistAllKeyrings.bind(this))

View File

@ -79,6 +79,8 @@ module.exports = class MetamaskController extends EventEmitter {
}) })
this.keyringController.on('newAccount', (address) => { this.keyringController.on('newAccount', (address) => {
this.preferencesController.setSelectedAddress(address) this.preferencesController.setSelectedAddress(address)
})
this.keyringController.on('newVault', (address) => {
autoFaucet(address) autoFaucet(address)
}) })