aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/metamask.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-05-24 05:43:17 +0800
committerDan Finlay <somniac@me.com>2016-05-24 05:43:17 +0800
commit0c73e583727e8cd67df7ad119e8d453306fa5c5d (patch)
tree350ed72bc2cc609bc6fd2e638cda3ad03b7d3e61 /ui/app/reducers/metamask.js
parent7f77fe1a790fbd466b91f5a8f6bf25fbd0982ae4 (diff)
parenta439e04ed4fae2bbf4da6cfca2a516991aa89178 (diff)
downloadtangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.gz
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.bz2
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.lz
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.xz
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.zst
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.zip
Merge pull request #204 from MetaMask/dev
Merge UI redesign into master
Diffstat (limited to 'ui/app/reducers/metamask.js')
-rw-r--r--ui/app/reducers/metamask.js25
1 files changed, 23 insertions, 2 deletions
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 9398f1497..a45327189 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:
@@ -69,18 +70,38 @@ function reduceMetamask(state, action) {
}
return newState
+ case actions.SHOW_NEW_VAULT_SEED:
+ return extend(metamaskState, {
+ isUnlocked: true,
+ isInitialized: false,
+ })
+
case actions.CLEAR_SEED_WORD_CACHE:
var newState = extend(metamaskState, {
+ isUnlocked: true,
isInitialized: true,
+ selectedAccount: action.value,
})
delete newState.seedWords
return newState
- case actions.CREATE_NEW_VAULT_IN_PROGRESS:
- return extend(metamaskState, {
+ case actions.SHOW_ACCOUNT_DETAIL:
+ const newState = extend(metamaskState, {
isUnlocked: true,
isInitialized: true,
+ selectedAccount: action.value,
+ selectedAddress: action.value,
})
+ delete newState.seedWords
+ return newState
+
+ case actions.SAVE_ACCOUNT_LABEL:
+ const account = action.value.account
+ const name = action.value.label
+ var id = {}
+ id[account] = extend(metamaskState.identities[account], { name })
+ var identities = extend(metamaskState.identities, id)
+ return extend(metamaskState, { identities })
default:
return metamaskState