add fix for ETH balance fetching (#662)

This commit is contained in:
Ian Lapham 2020-03-23 16:01:26 -04:00 committed by GitHub
parent 2b15979e93
commit d8c4ebc243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -416,6 +416,10 @@ export function useAllBalances(): Array<TokenAmount> {
Object.keys(state[chainId]).map(address => { Object.keys(state[chainId]).map(address => {
return Object.keys(state[chainId][address]).map(tokenAddress => { return Object.keys(state[chainId][address]).map(tokenAddress => {
if (state[chainId][address][tokenAddress].value) { if (state[chainId][address][tokenAddress].value) {
// fix if ETH found in local storage from old storage
if (tokenAddress === 'ETH') {
tokenAddress = WETH[chainId]
}
newBalances[chainId] = { newBalances[chainId] = {
...newBalances[chainId], ...newBalances[chainId],
[address]: { [address]: {