aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-01-30 16:50:02 +0800
committerFrankie <frankie.diamond@gmail.com>2017-01-30 16:50:02 +0800
commitf40629e5ae7d284e871d9dcd8b62fce34b6f2b39 (patch)
tree2212e6d50ccc877f4fe392d4d68745a2d59703a1 /app/scripts
parentfdee1e3701a84fe1321de348ec2d11bf5361a62d (diff)
parentb6909574a7036c396ed85809cbd90aa2171b012f (diff)
downloadtangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.tar
tangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.tar.gz
tangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.tar.bz2
tangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.tar.lz
tangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.tar.xz
tangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.tar.zst
tangerine-wallet-browser-f40629e5ae7d284e871d9dcd8b62fce34b6f2b39.zip
Merge branch 'dev' into messageManagerCleanUp
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/keyring-controller.js9
-rw-r--r--app/scripts/metamask-controller.js8
2 files changed, 13 insertions, 4 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index b56b5520f..5fbd731f3 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -246,6 +246,15 @@ class KeyringController extends EventEmitter {
return this.fullUpdate()
}
+ // Get Selected Account
+ //
+ // returns String
+ //
+ // Gets the state's `selectedAccount` value
+ getSelectedAccount () {
+ return this.store.getState().selectedAccount
+ }
+
// Save Account Label
// @string account
// @string label
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index a76d5cd86..bab005af2 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -65,7 +65,7 @@ module.exports = class MetamaskController extends EventEmitter {
txList: this.configManager.getTxList(),
txHistoryLimit: 40,
setTxList: this.configManager.setTxList.bind(this.configManager),
- getSelectedAccount: this.configManager.getSelectedAccount.bind(this.configManager),
+ getSelectedAccount: this.keyringController.getSelectedAccount.bind(this.keyringController),
getGasMultiplier: this.configManager.getGasMultiplier.bind(this.configManager),
getNetwork: this.getStateNetwork.bind(this),
signTransaction: this.keyringController.signTransaction.bind(this.keyringController),
@@ -117,7 +117,7 @@ module.exports = class MetamaskController extends EventEmitter {
rpcUrl: this.configManager.getCurrentRpcAddress(),
// account mgmt
getAccounts: (cb) => {
- let selectedAccount = this.configManager.getSelectedAccount()
+ let selectedAccount = this.keyringController.getSelectedAccount()
let result = selectedAccount ? [selectedAccount] : []
cb(null, result)
},
@@ -143,7 +143,7 @@ module.exports = class MetamaskController extends EventEmitter {
function selectPublicState(state) {
const result = { selectedAccount: undefined }
try {
- result.selectedAccount = state.config.selectedAccount
+ result.selectedAccount = state.KeyringController.selectedAccount
} catch (_) {}
return result
}
@@ -329,7 +329,7 @@ module.exports = class MetamaskController extends EventEmitter {
// ensuring they are only ever available in the background process.
clearSeedWordCache (cb) {
this.configManager.setSeedWords(null)
- cb(null, this.configManager.getSelectedAccount())
+ cb(null, this.keyringController.getSelectedAccount())
}
importAccountWithStrategy (strategy, args, cb) {