diff options
Move all of send state to metamask state.
Diffstat (limited to 'ui/app/reducers/metamask.js')
-rw-r--r-- | ui/app/reducers/metamask.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index a9a54e91e..6915dbb0f 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -24,6 +24,11 @@ function reduceMetamask (state, action) { send: { gasLimit: null, gasPrice: null, + gasTotal: null, + from: '', + to: '', + amount: '0x0', + memo: '', }, }, state.metamask) @@ -157,6 +162,7 @@ function reduceMetamask (state, action) { tokens: action.newTokens, }) + // metamask.send case actions.UPDATE_GAS_LIMIT: return extend(metamaskState, { send: { @@ -178,6 +184,46 @@ function reduceMetamask (state, action) { isAccountMenuOpen: !metamaskState.isAccountMenuOpen, }) + case actions.UPDATE_GAS_TOTAL: + return extend(metamaskState, { + send: { + ...metamaskState.send, + gasTotal: action.value, + }, + }) + + case actions.UPDATE_SEND_FROM: + return extend(metamaskState, { + send: { + ...metamaskState.send, + from: action.value, + }, + }) + + case actions.UPDATE_SEND_TO: + return extend(metamaskState, { + send: { + ...metamaskState.send, + to: action.value, + }, + }) + + case actions.UPDATE_SEND_AMOUNT: + return extend(metamaskState, { + send: { + ...metamaskState.send, + amount: action.value, + }, + }) + + case actions.UPDATE_SEND_MEMO: + return extend(metamaskState, { + send: { + ...metamaskState.send, + memo: action.value, + }, + }) + default: return metamaskState |