diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-06-22 04:56:04 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-06-22 04:56:04 +0800 |
commit | 8fde8a8921135112ccfdd13ce6b009755b5f71ed (patch) | |
tree | cd4ceb1dcd74a601506f92e5669e3022ca800c0c /ui/app/reducers | |
parent | ab15b4c8259d6f6c5ae9d1e51548d73cfc1c67cb (diff) | |
download | tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.gz tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.bz2 tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.lz tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.xz tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.zst tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.zip |
Manually linted
Diffstat (limited to 'ui/app/reducers')
-rw-r--r-- | ui/app/reducers/app.js | 4 | ||||
-rw-r--r-- | ui/app/reducers/identities.js | 1 | ||||
-rw-r--r-- | ui/app/reducers/metamask.js | 18 |
3 files changed, 11 insertions, 12 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 5ad6d82c3..f45be0433 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -1,6 +1,5 @@ const extend = require('xtend') const actions = require('../actions') -const valuesFor = require('../util').valuesFor const txHelper = require('../../lib/tx-helper') module.exports = reduceApp @@ -180,7 +179,7 @@ function reduceApp (state, action) { return extend(appState, { currentView: { name: 'accountDetail', - context: action.value || account, + context: action.value, }, accountDetail: { subview: 'transactions', @@ -205,7 +204,6 @@ function reduceApp (state, action) { }) case actions.SHOW_ACCOUNTS_PAGE: - var seedWords = state.metamask.seedWords return extend(appState, { currentView: { name: seedWords ? 'createVaultComplete' : 'accounts', diff --git a/ui/app/reducers/identities.js b/ui/app/reducers/identities.js index be5518b47..341a404e7 100644 --- a/ui/app/reducers/identities.js +++ b/ui/app/reducers/identities.js @@ -1,5 +1,4 @@ const extend = require('xtend') -const actions = require('../actions') module.exports = reduceIdentities diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 670312830..f3ef8eb11 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -4,6 +4,8 @@ const actions = require('../actions') module.exports = reduceMetamask function reduceMetamask (state, action) { + let newState + // clone + defaults var metamaskState = extend({ isInitialized: false, @@ -17,9 +19,9 @@ function reduceMetamask (state, action) { switch (action.type) { case actions.SHOW_ACCOUNTS_PAGE: - var state = extend(metamaskState) - delete state.seedWords - return state + newState = extend(metamaskState) + delete newState.seedWords + return newState case actions.UPDATE_METAMASK_STATE: return extend(metamaskState, action.value) @@ -58,16 +60,16 @@ function reduceMetamask (state, action) { case actions.COMPLETED_TX: var stringId = String(action.id) - var newState = extend(metamaskState, { + newState = extend(metamaskState, { unconfTxs: {}, unconfMsgs: {}, }) - for (var id in metamaskState.unconfTxs) { + for (const id in metamaskState.unconfTxs) { if (id !== stringId) { newState.unconfTxs[id] = metamaskState.unconfTxs[id] } } - for (var id in metamaskState.unconfMsgs) { + for (const id in metamaskState.unconfMsgs) { if (id !== stringId) { newState.unconfMsgs[id] = metamaskState.unconfMsgs[id] } @@ -81,7 +83,7 @@ function reduceMetamask (state, action) { }) case actions.CLEAR_SEED_WORD_CACHE: - var newState = extend(metamaskState, { + newState = extend(metamaskState, { isUnlocked: true, isInitialized: true, selectedAccount: action.value, @@ -90,7 +92,7 @@ function reduceMetamask (state, action) { return newState case actions.SHOW_ACCOUNT_DETAIL: - const newState = extend(metamaskState, { + newState = extend(metamaskState, { isUnlocked: true, isInitialized: true, selectedAccount: action.value, |