aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-01-18 19:29:54 +0800
committerFabio Berger <me@fabioberger.com>2018-01-18 19:29:54 +0800
commitf9c21efc3073fea4578d46a47f5a08214c592e87 (patch)
treeb9678c95225ea8c8143c2928a4515c024282d0fb /packages/website/ts
parent807d9e3eef883541c4f43838e6ca702b120974e1 (diff)
downloaddexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.tar
dexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.tar.gz
dexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.tar.bz2
dexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.tar.lz
dexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.tar.xz
dexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.tar.zst
dexon-sol-tools-f9c21efc3073fea4578d46a47f5a08214c592e87.zip
Use intervalUtils.clearAsyncExcludingInterval instead of calling clearInterval directly for grepability
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/blockchain.ts6
-rw-r--r--packages/website/ts/web3_wrapper.ts2
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index e82243c83..66f982427 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -372,12 +372,12 @@ 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, (err: Error) => {
utils.consoleLog(`Polling tokenBalance failed: ${err}`);
- clearInterval(this._zrxPollIntervalId);
+ intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId);
delete this._zrxPollIntervalId;
});
}
@@ -475,7 +475,7 @@ export class Blockchain {
this._web3Wrapper.updatePrevUserAddress(newUserAddress);
}
public destroy() {
- clearInterval(this._zrxPollIntervalId);
+ intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId);
this._web3Wrapper.destroy();
this._stopWatchingExchangeLogFillEvents();
}
diff --git a/packages/website/ts/web3_wrapper.ts b/packages/website/ts/web3_wrapper.ts
index f5e3985c5..407c62aaa 100644
--- a/packages/website/ts/web3_wrapper.ts
+++ b/packages/website/ts/web3_wrapper.ts
@@ -149,6 +149,6 @@ export class Web3Wrapper {
}
}
private _stopEmittingNetworkConnectionAndUserBalanceStateAsync() {
- clearInterval(this._watchNetworkAndBalanceIntervalId);
+ intervalUtils.clearAsyncExcludingInterval(this._watchNetworkAndBalanceIntervalId);
}
}