diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-04-26 05:14:34 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-04-26 05:14:34 +0800 |
commit | 1025eb3b4f90c2b909fe9d238cebba878c8ce2db (patch) | |
tree | 22545ef15f6bb672e3f3070cda9de3a80504ebd2 /app/scripts/lib/config-manager.js | |
parent | 88ed546a9ae9a04f9ba09fe1d24910fe6c88292f (diff) | |
download | tangerine-wallet-browser-1025eb3b4f90c2b909fe9d238cebba878c8ce2db.tar.gz tangerine-wallet-browser-1025eb3b4f90c2b909fe9d238cebba878c8ce2db.tar.zst tangerine-wallet-browser-1025eb3b4f90c2b909fe9d238cebba878c8ce2db.zip |
Persist selected account
When selecting an account, we now persist the selection to the `configManager`, so the selection can be restored when re-unlocking Metamask.
Also found the bug where `rawtestrpc` was still being used as a default, and fixed it!
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r-- | app/scripts/lib/config-manager.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index c79dc7a8f..102327c2d 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -102,6 +102,17 @@ ConfigManager.prototype.setWallet = function(wallet) { this.setData(data) } +ConfigManager.prototype.getSelectedAccount = function() { + var config = this.getConfig() + return config.selectedAccount +} + +ConfigManager.prototype.setSelectedAccount = function(address) { + var config = this.getConfig() + config.selectedAccount = address + this.setConfig(config) +} + ConfigManager.prototype.getWallet = function() { return this.migrator.getData().wallet } |