diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-01-18 22:27:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 22:27:01 +0800 |
commit | 9203813a612f835043dcd42302af97ad0372790d (patch) | |
tree | 9beaa00563c4f0a026d4921ddc8d35bbc0278da0 /packages/website/ts/blockchain.ts | |
parent | e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48 (diff) | |
parent | f9c21efc3073fea4578d46a47f5a08214c592e87 (diff) | |
download | dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.tar dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.tar.gz dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.tar.bz2 dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.tar.lz dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.tar.xz dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.tar.zst dexon-sol-tools-9203813a612f835043dcd42302af97ad0372790d.zip |
Merge pull request #325 from 0xProject/fix/portal-bugs
Small Fixes/Additions
Diffstat (limited to 'packages/website/ts/blockchain.ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 1320fbeb9..66f982427 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -372,10 +372,14 @@ export class Blockchain { const [balance] = await this.getTokenBalanceAndAllowanceAsync(this._userAddress, token.address); if (!balance.eq(currBalance)) { this._dispatcher.replaceTokenBalanceByAddress(token.address, balance); - clearInterval(this._zrxPollIntervalId); + intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId); delete this._zrxPollIntervalId; } - }, 5000); + }, 5000, (err: Error) => { + utils.consoleLog(`Polling tokenBalance failed: ${err}`); + intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId); + delete this._zrxPollIntervalId; + }); } public async signOrderHashAsync(orderHash: string): Promise<SignatureData> { utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); @@ -471,7 +475,7 @@ export class Blockchain { this._web3Wrapper.updatePrevUserAddress(newUserAddress); } public destroy() { - clearInterval(this._zrxPollIntervalId); + intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId); this._web3Wrapper.destroy(); this._stopWatchingExchangeLogFillEvents(); } |