From 01b36b494996c641a3cb5bd3fd894624a8dad210 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 12 Nov 2018 17:30:28 -0800 Subject: fix: remove requirement of default case in all switch statements --- packages/instant/src/redux/async_data.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'packages/instant/src/redux/async_data.ts') diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts index 2682677b9..15ac31a5a 100644 --- a/packages/instant/src/redux/async_data.ts +++ b/packages/instant/src/redux/async_data.ts @@ -1,4 +1,5 @@ import { AssetProxyId } from '@0x/types'; +import { Web3Wrapper } from '@0x/web3-wrapper'; import * as _ from 'lodash'; import { Dispatch } from 'redux'; @@ -64,19 +65,13 @@ export const asyncData = { const activeAddress = availableAddresses[0]; dispatch(actions.setAccountStateReady(activeAddress)); // tslint:disable-next-line:no-floating-promises - asyncData.fetchAccountBalanceAndDispatchToStore(providerState, dispatch); + asyncData.fetchAccountBalanceAndDispatchToStore(activeAddress, providerState.web3Wrapper, dispatch); } else { dispatch(actions.setAccountStateLocked()); } }, - fetchAccountBalanceAndDispatchToStore: async (providerState: ProviderState, dispatch: Dispatch) => { - const web3Wrapper = providerState.web3Wrapper; - const account = providerState.account; - // if (account.state !== AccountState.Ready) { - // return; - // } + fetchAccountBalanceAndDispatchToStore: async (address: string, web3Wrapper: Web3Wrapper, dispatch: Dispatch) => { try { - const address = account.address; const ethBalanceInWei = await web3Wrapper.getBalanceInWeiAsync(address); dispatch(actions.updateAccountEthBalance({ address, ethBalanceInWei })); } catch (e) { -- cgit v1.2.3