Fix bug where could not switch to Ledger and back

This commit is contained in:
Fabio Berger
2018-01-28 17:45:20 +01:00
parent 6206ebc994
commit 005a02efeb
6 changed files with 65 additions and 31 deletions

View File

@@ -181,6 +181,25 @@ export function reducer(state: State = INITIAL_STATE, action: Action) {
};
}
case ActionTypes.BatchDispatch: {
const tokenByAddress = state.tokenByAddress;
const tokens = action.data.tokens;
_.each(tokens, token => {
const updatedToken = {
...tokenByAddress[token.address],
...token,
};
tokenByAddress[token.address] = updatedToken;
});
return {
...state,
networkId: action.data.networkId,
userAddress: action.data.userAddress,
sideToAssetToken: action.data.sideToAssetToken,
tokenByAddress,
};
}
case ActionTypes.ForceTokenStateRefetch:
return {
...state,