diff options
author | Fabio Berger <me@fabioberger.com> | 2018-01-18 15:02:36 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-01-18 15:02:36 +0800 |
commit | 996e9e9102dc3f7ebcd6328c59593410c397c779 (patch) | |
tree | 5caa8de01a6c5d3ab5cb5f03eb6ed77f49784cf2 /packages/website/ts/web3_wrapper.ts | |
parent | eb0d7df50b23af325edaecd7a7cccb269d7c8f88 (diff) | |
download | dexon-0x-contracts-996e9e9102dc3f7ebcd6328c59593410c397c779.tar.gz dexon-0x-contracts-996e9e9102dc3f7ebcd6328c59593410c397c779.tar.zst dexon-0x-contracts-996e9e9102dc3f7ebcd6328c59593410c397c779.zip |
Add missing onError callbacks
Diffstat (limited to 'packages/website/ts/web3_wrapper.ts')
-rw-r--r-- | packages/website/ts/web3_wrapper.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/website/ts/web3_wrapper.ts b/packages/website/ts/web3_wrapper.ts index 6f260dc48..f5e3985c5 100644 --- a/packages/website/ts/web3_wrapper.ts +++ b/packages/website/ts/web3_wrapper.ts @@ -1,6 +1,7 @@ import { BigNumber, intervalUtils, promisify } from '@0xproject/utils'; import * as _ from 'lodash'; import { Dispatcher } from 'ts/redux/dispatcher'; +import { utils } from 'ts/utils/utils'; import * as Web3 from 'web3'; export class Web3Wrapper { @@ -135,7 +136,10 @@ export class Web3Wrapper { await this._updateUserEtherBalanceAsync(this._prevUserAddress); } } - }, 5000); + }, 5000, (err: Error) => { + utils.consoleLog(`Watching network and balances failed: ${err}`); + this._stopEmittingNetworkConnectionAndUserBalanceStateAsync(); + }); } private async _updateUserEtherBalanceAsync(userAddress: string) { const balance = await this.getBalanceInEthAsync(userAddress); |