diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-18 23:18:25 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-18 23:18:25 +0800 |
commit | 614ea14a7fe90252d2bef8a97b3c376ae4498a17 (patch) | |
tree | 09051098c9ecf1c98f29d0de4aeee4af31d41bda /packages/website/ts/blockchain.ts | |
parent | ce45f9900618958d9cb71cb71a32446021698ee6 (diff) | |
download | dexon-sol-tools-614ea14a7fe90252d2bef8a97b3c376ae4498a17.tar.gz dexon-sol-tools-614ea14a7fe90252d2bef8a97b3c376ae4498a17.tar.zst dexon-sol-tools-614ea14a7fe90252d2bef8a97b3c376ae4498a17.zip |
Fix prettier
Diffstat (limited to 'packages/website/ts/blockchain.ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 66f982427..5530701c0 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -368,18 +368,22 @@ export class Blockchain { const [currBalance] = await this.getTokenBalanceAndAllowanceAsync(this._userAddress, token.address); - this._zrxPollIntervalId = intervalUtils.setAsyncExcludingInterval(async () => { - const [balance] = await this.getTokenBalanceAndAllowanceAsync(this._userAddress, token.address); - if (!balance.eq(currBalance)) { - this._dispatcher.replaceTokenBalanceByAddress(token.address, balance); + this._zrxPollIntervalId = intervalUtils.setAsyncExcludingInterval( + async () => { + const [balance] = await this.getTokenBalanceAndAllowanceAsync(this._userAddress, token.address); + if (!balance.eq(currBalance)) { + this._dispatcher.replaceTokenBalanceByAddress(token.address, balance); + intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId); + delete this._zrxPollIntervalId; + } + }, + 5000, + (err: Error) => { + utils.consoleLog(`Polling tokenBalance failed: ${err}`); intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId); delete this._zrxPollIntervalId; - } - }, 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.'); |