aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/metamask.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-13 16:13:14 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-13 16:24:05 +0800
commit041b5493dc43c9f8b69dc5a1dde4b319638618a7 (patch)
treed74812d939398896cc275bbf4080faa26aa35e95 /ui/app/reducers/metamask.js
parentf2676d12413e379f3876e8e36b73478c66ed6ad0 (diff)
downloadtangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.tar
tangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.tar.gz
tangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.tar.bz2
tangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.tar.lz
tangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.tar.xz
tangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.tar.zst
tangerine-wallet-browser-041b5493dc43c9f8b69dc5a1dde4b319638618a7.zip
Streamlined some transition logic
Fixes #122 Had used multiple actions for some transitions, which would lead to brief intermediary states. Now making a few actions much more explicit about what they route to, so there is less intermediary logic, and we can transition confidently to the correct view.
Diffstat (limited to 'ui/app/reducers/metamask.js')
-rw-r--r--ui/app/reducers/metamask.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 8bf5c8aae..8628e84d2 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -29,6 +29,7 @@ function reduceMetamask(state, action) {
return extend(metamaskState, {
isUnlocked: true,
isInitialized: true,
+ selectedAccount: action.value,
})
case actions.LOCK_METAMASK:
@@ -85,9 +86,14 @@ function reduceMetamask(state, action) {
return newState
case actions.SHOW_ACCOUNT_DETAIL:
- return extend(metamaskState, {
+ const newState = extend(metamaskState, {
+ isUnlocked: true,
+ isInitialized: true,
selectedAccount: action.value,
+ selectedAddress: action.value,
})
+ delete newState.seedWords
+ return newState
default:
return metamaskState