From 1025eb3b4f90c2b909fe9d238cebba878c8ce2db Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 25 Apr 2016 14:14:34 -0700 Subject: 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! --- app/scripts/lib/config-manager.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/scripts/lib/config-manager.js') 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 } -- cgit