diff options
Tests for send.duck.js
Diffstat (limited to 'ui/app/ducks/send.duck.js')
-rw-r--r-- | ui/app/ducks/send.duck.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ui/app/ducks/send.duck.js b/ui/app/ducks/send.duck.js index aef493ea0..055cc05c1 100644 --- a/ui/app/ducks/send.duck.js +++ b/ui/app/ducks/send.duck.js @@ -16,32 +16,34 @@ const initState = { // Reducer export default function reducer ({ send: sendState = initState }, action = {}) { + const newState = extend({}, sendState) + switch (action.type) { case OPEN_FROM_DROPDOWN: - return extend(sendState, { + return extend(newState, { fromDropdownOpen: true, }) case CLOSE_FROM_DROPDOWN: - return extend(sendState, { + return extend(newState, { fromDropdownOpen: false, }) case OPEN_TO_DROPDOWN: - return extend(sendState, { + return extend(newState, { toDropdownOpen: true, }) case CLOSE_TO_DROPDOWN: - return extend(sendState, { + return extend(newState, { toDropdownOpen: false, }) case UPDATE_SEND_ERRORS: - return extend(sendState, { + return extend(newState, { errors: { - ...sendState.errors, + ...newState.errors, ...action.value, }, }) default: - return sendState + return newState } } |