diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-04-26 05:34:43 +0800 |
---|---|---|
committer | kumavis <kumavis@users.noreply.github.com> | 2016-04-26 05:34:43 +0800 |
commit | 7497b2c8135324382af019d8705c688d71064edc (patch) | |
tree | b032651204c21562a2431f3d3121f9ac81fe4c86 /app/scripts | |
parent | 652c1d96c1a80864218fa4dadf7aa0f4102a583b (diff) | |
parent | 82ac8bde5d246b58e90a7e428ee685cf1ee7c351 (diff) | |
download | tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.tar tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.tar.gz tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.tar.bz2 tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.tar.lz tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.tar.xz tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.tar.zst tangerine-wallet-browser-7497b2c8135324382af019d8705c688d71064edc.zip |
Merge pull request #142 from MetaMask/DetailViewFirst
Make account detail view into main view
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/lib/config-manager.js | 11 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 11 |
2 files changed, 17 insertions, 5 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 } diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 7763d33d8..92d0f9668 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -9,7 +9,7 @@ const extend = require('xtend') const createId = require('web3-provider-engine/util/random-id') const autoFaucet = require('./auto-faucet') const configManager = require('./config-manager-singleton') -const DEFAULT_RPC = 'https://rawtestrpc.metamask.io/' +const DEFAULT_RPC = 'https://testrpc.metamask.io/' module.exports = IdentityStore @@ -72,7 +72,7 @@ IdentityStore.prototype.setStore = function(store){ IdentityStore.prototype.clearSeedWordCache = function(cb) { configManager.setShowSeedWords(false) - cb() + cb(null, configManager.getSelectedAccount()) } IdentityStore.prototype.getState = function(){ @@ -84,6 +84,7 @@ IdentityStore.prototype.getState = function(){ seedWords: seedWords, unconfTxs: configManager.unconfirmedTxs(), transactions: configManager.getTxList(), + selectedAddress: configManager.getSelectedAccount(), })) } @@ -96,7 +97,7 @@ IdentityStore.prototype.getSeedIfUnlocked = function() { } IdentityStore.prototype.getSelectedAddress = function(){ - return this._currentState.selectedAddress + return configManager.getSelectedAccount() } IdentityStore.prototype.setSelectedAddress = function(address){ @@ -105,7 +106,7 @@ IdentityStore.prototype.setSelectedAddress = function(address){ address = addresses[0] } - this._currentState.selectedAddress = address + configManager.setSelectedAccount(address) this._didUpdate() } @@ -120,7 +121,7 @@ IdentityStore.prototype.submitPassword = function(password, cb){ if (err) return cb(err) // load identities before returning... this._loadIdentities() - cb() + cb(null, configManager.getSelectedAccount()) }) } |