aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/metamask.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
commit8fde8a8921135112ccfdd13ce6b009755b5f71ed (patch)
treecd4ceb1dcd74a601506f92e5669e3022ca800c0c /ui/app/reducers/metamask.js
parentab15b4c8259d6f6c5ae9d1e51548d73cfc1c67cb (diff)
downloadtangerine-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/metamask.js')
-rw-r--r--ui/app/reducers/metamask.js18
1 files changed, 10 insertions, 8 deletions
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,