diff options
metamask - adopt isInitialized from keyring controller
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/keyring-controller.js | 3 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 22ceec889..be54ab00b 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -78,13 +78,10 @@ class KeyringController extends EventEmitter { // in this class, but will need to be Promisified when we move our // persistence to an async model. getState () { - const state = this.store.getState() // old wallet - const wallet = this.configManager.getWallet() const memState = this.memStore.getState() const result = { // computed - isInitialized: (!!wallet || !!state.vault), isUnlocked: (!!this.password), // memStore keyringTypes: memState.keyringTypes, diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 23ced75f1..222a1d618 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -169,14 +169,21 @@ module.exports = class MetamaskController extends EventEmitter { // getState () { + const wallet = this.configManager.getWallet() + const vault = this.keyringController.store.getState().vault + const isInitialized = (!!wallet || !!vault) return extend( + { + isInitialized, + }, this.state, this.ethStore.getState(), - this.configManager.getConfig(), this.txManager.getState(), this.keyringController.getState(), this.preferencesController.store.getState(), this.noticeController.getState(), + // config manager + this.configManager.getConfig(), { shapeShiftTxList: this.configManager.getShapeShiftTxList(), lostAccounts: this.configManager.getLostAccounts(), |