aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-06-15 05:21:50 +0800
committerDan Finlay <dan@danfinlay.com>2017-06-15 05:21:50 +0800
commitb7b9e0c1ac203d39196753f39f17a1fe2f4751e5 (patch)
tree278b3055a84952afbd063b9c95d10d4320e42048 /app
parent3df2f2b2d4239a033ba23d14a75e0a10ece584aa (diff)
downloadtangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.tar
tangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.tar.gz
tangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.tar.bz2
tangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.tar.lz
tangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.tar.xz
tangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.tar.zst
tangerine-wallet-browser-b7b9e0c1ac203d39196753f39f17a1fe2f4751e5.zip
Persist selected account tab
Also improve error handling with token balances.
Diffstat (limited to 'app')
-rw-r--r--app/scripts/controllers/preferences.js8
-rw-r--r--app/scripts/metamask-controller.js1
2 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 7212c7c43..aa8e05fcc 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -7,6 +7,7 @@ class PreferencesController {
constructor (opts = {}) {
const initState = extend({
frequentRpcList: [],
+ currentAccountTab: 'history',
}, opts.initState)
this.store = new ObservableStore(initState)
}
@@ -35,6 +36,13 @@ class PreferencesController {
})
}
+ setCurrentAccountTab (currentAccountTab) {
+ return new Promise((resolve, reject) => {
+ this.store.updateState({ currentAccountTab })
+ resolve()
+ })
+ }
+
addToFrequentRpcList (_url) {
const rpcList = this.getFrequentRpcList()
const index = rpcList.findIndex((element) => { return element === _url })
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index a7eb3d056..410693df4 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -275,6 +275,7 @@ module.exports = class MetamaskController extends EventEmitter {
// PreferencesController
setSelectedAddress: nodeify(preferencesController.setSelectedAddress).bind(preferencesController),
+ setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab).bind(preferencesController),
setDefaultRpc: nodeify(this.setDefaultRpc).bind(this),
setCustomRpc: nodeify(this.setCustomRpc).bind(this),