diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-11 19:04:46 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-11 19:04:46 +0800 |
commit | 56a8e0a09a61ca2c399c676da695bf4cd4ed63a6 (patch) | |
tree | 0b2bb05f7101f6e27305dd8170f703e247cd8400 /packages/website/ts/redux/reducer.ts | |
parent | 4c08667a078ac9ca1ed5dc62d87a8cfe3b903741 (diff) | |
download | dexon-0x-contracts-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.gz dexon-0x-contracts-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.tar.zst dexon-0x-contracts-56a8e0a09a61ca2c399c676da695bf4cd4ed63a6.zip |
Fix userAddress bugs
Diffstat (limited to 'packages/website/ts/redux/reducer.ts')
-rw-r--r-- | packages/website/ts/redux/reducer.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/website/ts/redux/reducer.ts b/packages/website/ts/redux/reducer.ts index 2f3150f92..a628f65c2 100644 --- a/packages/website/ts/redux/reducer.ts +++ b/packages/website/ts/redux/reducer.ts @@ -184,10 +184,11 @@ export function reducer(state: State = INITIAL_STATE, action: Action) { } case ActionTypes.BatchDispatch: { + const userAddress = _.isUndefined(action.data.userAddressIfExists) ? '' : action.data.userAddressIfExists; return { ...state, networkId: action.data.networkId, - userAddress: _.isUndefined(action.data.userAddress) ? '' : action.data.userAddress, + userAddress, sideToAssetToken: action.data.sideToAssetToken, tokenByAddress: action.data.tokenByAddress, }; @@ -284,9 +285,10 @@ export function reducer(state: State = INITIAL_STATE, action: Action) { } case ActionTypes.UpdateUserAddress: { + const userAddress = _.isUndefined(action.data) ? '' : action.data; return { ...state, - userAddress: _.isUndefined(action.data) ? '' : action.data, + userAddress, }; } |