aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-02-01 14:35:11 +0800
committerkumavis <aaron@kumavis.me>2017-02-01 14:35:11 +0800
commitad060e267810dfd1217d5ddf40516976c8b2d68e (patch)
treefca166f2e545d8d8cb8122ed0c29fb246b524ef4 /app
parentc0d3db6a8ce2fe0522fa4e3cba1e01d10469280f (diff)
downloadtangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.tar
tangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.tar.gz
tangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.tar.bz2
tangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.tar.lz
tangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.tar.xz
tangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.tar.zst
tangerine-wallet-browser-ad060e267810dfd1217d5ddf40516976c8b2d68e.zip
metamask - inherit some configManager state from keyring controller
Diffstat (limited to 'app')
-rw-r--r--app/scripts/keyring-controller.js20
-rw-r--r--app/scripts/metamask-controller.js3
2 files changed, 13 insertions, 10 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 3737d1b55..a7e5fed71 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -2,7 +2,6 @@ const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN
const bip39 = require('bip39')
const EventEmitter = require('events').EventEmitter
-const extend = require('xtend')
const ObservableStore = require('obs-store')
const filter = require('promise-filter')
const encryptor = require('browser-passworder')
@@ -33,7 +32,9 @@ class KeyringController extends EventEmitter {
super()
const initState = opts.initState || {}
this.store = new ObservableStore(initState)
- this.memStore = new ObservableStore({})
+ this.memStore = new ObservableStore({
+ keyrings: [],
+ })
this.configManager = opts.configManager
this.ethStore = opts.ethStore
this.encryptor = encryptor
@@ -80,7 +81,7 @@ class KeyringController extends EventEmitter {
// old wallet
const wallet = this.configManager.getWallet()
const memState = this.memStore.getState()
- return extend(memState, {
+ const result = {
// computed
isInitialized: (!!wallet || !!state.vault),
isUnlocked: (!!this.password),
@@ -88,16 +89,15 @@ class KeyringController extends EventEmitter {
keyringTypes: this.keyringTypes.map(krt => krt.type),
// memStore
identities: this.identities,
- // configManager
- seedWords: this.configManager.getSeedWords(),
- isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
- currentFiat: this.configManager.getCurrentFiat(),
- conversionRate: this.configManager.getConversionRate(),
- conversionDate: this.configManager.getConversionDate(),
+ keyrings: memState.keyrings,
// messageManager
unconfMsgs: messageManager.unconfirmedMsgs(),
messages: messageManager.getMsgList(),
- })
+ // configManager
+ seedWords: this.configManager.getSeedWords(),
+ isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
+ }
+ return result
}
// Create New Vault And Keychain
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 17b5683a1..23ced75f1 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -180,6 +180,9 @@ module.exports = class MetamaskController extends EventEmitter {
{
shapeShiftTxList: this.configManager.getShapeShiftTxList(),
lostAccounts: this.configManager.getLostAccounts(),
+ currentFiat: this.configManager.getCurrentFiat(),
+ conversionRate: this.configManager.getConversionRate(),
+ conversionDate: this.configManager.getConversionDate(),
}
)
}