aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-31 07:08:31 +0800
committerkumavis <aaron@kumavis.me>2017-01-31 07:08:31 +0800
commitf9b31fe2c3a43339a4519761e4c8b2f3813e85e0 (patch)
tree123f368b533b374a89cb5e5da593d3babb5002e2 /app/scripts/metamask-controller.js
parentb1de2cdefa2341eeab8d0269a1b14b349fdd5d16 (diff)
downloadtangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.tar
tangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.tar.gz
tangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.tar.bz2
tangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.tar.lz
tangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.tar.xz
tangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.tar.zst
tangerine-wallet-browser-f9b31fe2c3a43339a4519761e4c8b2f3813e85e0.zip
rename selectedAccount to selectedAddress
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 64deae426..e081188ce 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -62,8 +62,9 @@ module.exports = class MetamaskController extends EventEmitter {
configManager: this.configManager,
getNetwork: this.getStateNetwork.bind(this),
})
- this.keyringController.on('newAccount', (account) => {
- autoFaucet(account)
+ this.keyringController.on('newAccount', (address) => {
+ this.preferencesController.setSelectedAddress(address)
+ autoFaucet(address)
})
// tx mgmt
@@ -176,6 +177,7 @@ module.exports = class MetamaskController extends EventEmitter {
this.configManager.getConfig(),
this.txManager.getState(),
keyringControllerState,
+ this.preferencesController.store.getState(),
this.noticeController.getState(),
{
shapeShiftTxList: this.configManager.getShapeShiftTxList(),
@@ -223,7 +225,7 @@ module.exports = class MetamaskController extends EventEmitter {
submitPassword: this.submitPassword.bind(this),
// PreferencesController
- setSelectedAccount: nodeify(preferencesController.setSelectedAccount).bind(preferencesController),
+ setSelectedAddress: nodeify(preferencesController.setSelectedAddress).bind(preferencesController),
// KeyringController
setLocked: nodeify(keyringController.setLocked).bind(keyringController),
@@ -351,7 +353,7 @@ module.exports = class MetamaskController extends EventEmitter {
return this.keyringController.addNewKeyring('Simple Key Pair', [ privateKey ])
})
.then(keyring => keyring.getAccounts())
- .then((accounts) => this.preferencesController.setSelectedAccount(accounts[0]))
+ .then((accounts) => this.preferencesController.setSelectedAddress(accounts[0]))
.then(() => { cb(null, this.keyringController.fullUpdate()) })
.catch((reason) => { cb(reason) })
}