aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/reducers')
-rw-r--r--ui/app/reducers/app.js1
-rw-r--r--ui/app/reducers/metamask.js46
2 files changed, 45 insertions, 2 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index d84f264c9..3a4fb536d 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -175,6 +175,7 @@ function reduceApp (state, action) {
name: 'import-menu',
},
transForward: true,
+ warning: null,
})
case actions.SHOW_INFO_PAGE:
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 50c9712ff..83161320e 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -27,11 +27,13 @@ function reduceMetamask (state, action) {
gasLimit: null,
gasPrice: null,
gasTotal: null,
+ tokenBalance: null,
from: '',
to: '',
amount: '0x0',
memo: '',
errors: {},
+ editingTransactionId: null,
},
coinOptions: {},
}, state.metamask)
@@ -107,6 +109,14 @@ function reduceMetamask (state, action) {
}
return newState
+ case actions.EDIT_TX:
+ return extend(metamaskState, {
+ send: {
+ ...metamaskState.send,
+ editingTransactionId: action.value,
+ },
+ })
+
case actions.SHOW_NEW_VAULT_SEED:
return extend(metamaskState, {
isUnlocked: true,
@@ -140,9 +150,9 @@ function reduceMetamask (state, action) {
case actions.SAVE_ACCOUNT_LABEL:
const account = action.value.account
const name = action.value.label
- var id = {}
+ const id = {}
id[account] = extend(metamaskState.identities[account], { name })
- var identities = extend(metamaskState.identities, id)
+ const identities = extend(metamaskState.identities, id)
return extend(metamaskState, { identities })
case actions.SET_CURRENT_FIAT:
@@ -196,6 +206,14 @@ function reduceMetamask (state, action) {
},
})
+ case actions.UPDATE_SEND_TOKEN_BALANCE:
+ return extend(metamaskState, {
+ send: {
+ ...metamaskState.send,
+ tokenBalance: action.value,
+ },
+ })
+
case actions.UPDATE_SEND_FROM:
return extend(metamaskState, {
send: {
@@ -239,20 +257,44 @@ function reduceMetamask (state, action) {
},
})
+ case actions.UPDATE_SEND:
+ return extend(metamaskState, {
+ send: {
+ ...metamaskState.send,
+ ...action.value,
+ },
+ })
+
case actions.CLEAR_SEND:
return extend(metamaskState, {
send: {
gasLimit: null,
gasPrice: null,
gasTotal: null,
+ tokenBalance: null,
from: '',
to: '',
amount: '0x0',
memo: '',
errors: {},
+ editingTransactionId: null,
},
})
+ case actions.UPDATE_TRANSACTION_PARAMS:
+ const { id: txId, value } = action
+ let { selectedAddressTxList } = metamaskState
+ selectedAddressTxList = selectedAddressTxList.map(tx => {
+ if (tx.id === txId) {
+ tx.txParams = value
+ }
+ return tx
+ })
+
+ return extend(metamaskState, {
+ selectedAddressTxList,
+ })
+
case actions.PAIR_UPDATE:
const { value: { marketinfo: pairMarketInfo } } = action
return extend(metamaskState, {