diff options
rename selectedAccount to selectedAddress
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 10 |
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) }) } |