diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-05-13 16:13:14 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-05-13 16:24:05 +0800 |
commit | 041b5493dc43c9f8b69dc5a1dde4b319638618a7 (patch) | |
tree | d74812d939398896cc275bbf4080faa26aa35e95 /ui/app/reducers | |
parent | f2676d12413e379f3876e8e36b73478c66ed6ad0 (diff) | |
download | tangerine-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')
-rw-r--r-- | ui/app/reducers/metamask.js | 8 |
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 |