aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-10-18 04:09:41 +0800
committerDan Finlay <dan@danfinlay.com>2017-10-18 04:09:41 +0800
commitab31eb6a17f5ab230fe47df66344cbce59223306 (patch)
treeb116f1271e66e60d4ca619edca6a07d0f523060d /app/scripts/metamask-controller.js
parent701887bb19171b1cef0f6d5f6359d8cf39d80a01 (diff)
downloadtangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.tar
tangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.tar.gz
tangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.tar.bz2
tangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.tar.lz
tangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.tar.xz
tangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.tar.zst
tangerine-wallet-browser-ab31eb6a17f5ab230fe47df66344cbce59223306.zip
Select first account on new vault creation
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index a742f3cba..2a45e413b 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -336,7 +336,7 @@ module.exports = class MetamaskController extends EventEmitter {
// KeyringController
setLocked: nodeify(keyringController.setLocked, keyringController),
- createNewVaultAndKeychain: nodeify(keyringController.createNewVaultAndKeychain, keyringController),
+ createNewVaultAndKeychain: this.createNewVaultAndKeychain.bind(this),
createNewVaultAndRestore: nodeify(keyringController.createNewVaultAndRestore, keyringController),
addNewKeyring: nodeify(keyringController.addNewKeyring, keyringController),
saveAccountLabel: nodeify(keyringController.saveAccountLabel, keyringController),
@@ -458,6 +458,17 @@ module.exports = class MetamaskController extends EventEmitter {
// Vault Management
//
+ createNewVaultAndKeychain (password, cb) {
+ this.keyringController.createNewVaultAndKeychain(password)
+ .then((vault) => {
+ const { identities } = vault
+ const address = Object.keys(identities)[0]
+ this.preferencesController.setSelectedAddress(address)
+ cb(null, vault)
+ })
+ .catch(reason => cb(reason))
+ }
+
submitPassword (password, cb) {
return this.keyringController.submitPassword(password)
.then((newState) => { cb(null, newState) })