Fix userAddress bugs

This commit is contained in:
Fabio Berger
2018-03-11 12:04:46 +01:00
parent 4c08667a07
commit 56a8e0a09a
4 changed files with 15 additions and 11 deletions

View File

@@ -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,
};
}