aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-26 03:20:33 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-26 03:38:43 +0800
commit2dd7bd6bd0d026da339c1e55d52270674be13f3d (patch)
treebb4b6df2be4720905db8960c3c6e4e40694eb7b9 /app
parent652c1d96c1a80864218fa4dadf7aa0f4102a583b (diff)
downloadtangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.tar
tangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.tar.gz
tangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.tar.bz2
tangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.tar.lz
tangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.tar.xz
tangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.tar.zst
tangerine-wallet-browser-2dd7bd6bd0d026da339c1e55d52270674be13f3d.zip
Make account detail view the primary view
- When unlocking, the first account is now selected by default and displayed as the main view. - There is now a "CHANGE ACCT" button on the detail view to show the accounts list. - Clicking an account from the accounts list now navigates to the detail view and selects that account. - Config/Info screen "back" buttons now fire a new action, `GO_HOME`, which is configured to navigate to the accountDetail view, putting that logic in one place. - When locking and unlocking again, the first account is always displayed, eventually we should persist the selection.
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/idStore.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 7763d33d8..525fdae30 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -72,7 +72,8 @@ IdentityStore.prototype.setStore = function(store){
IdentityStore.prototype.clearSeedWordCache = function(cb) {
configManager.setShowSeedWords(false)
- cb()
+ var accounts = this._loadIdentities()
+ cb(null, accounts)
}
IdentityStore.prototype.getState = function(){
@@ -119,8 +120,8 @@ IdentityStore.prototype.submitPassword = function(password, cb){
this._tryPassword(password, (err) => {
if (err) return cb(err)
// load identities before returning...
- this._loadIdentities()
- cb()
+ var accounts = this._loadIdentities()
+ cb(null, accounts)
})
}
@@ -212,6 +213,7 @@ IdentityStore.prototype._loadIdentities = function(){
if (!this._isUnlocked()) throw new Error('not unlocked')
var addresses = this._getAddresses()
+ var accountArray = []
addresses.forEach((address, i) => {
// // add to ethStore
this._ethStore.addAccount(address)
@@ -223,8 +225,10 @@ IdentityStore.prototype._loadIdentities = function(){
mayBeFauceting: this._mayBeFauceting(i),
}
this._currentState.identities[address] = identity
+ accountArray.push(identity)
})
this._didUpdate()
+ return accountArray
}
// mayBeFauceting