aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/web3_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-16 02:37:03 +0800
committerFabio Berger <me@fabioberger.com>2017-12-16 02:37:03 +0800
commitb46dd2e0a277340c19fa137a436981cc53c8cb80 (patch)
treed2814176fe8ffc5ec6a61534aa77487aae6bcc13 /packages/website/ts/web3_wrapper.ts
parent484dd4c33aa5786def1f0b159f5b51f99a585aa8 (diff)
parent3eb08735d4d0fe4b046dd6b74f5ed503cf5c64e3 (diff)
downloaddexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.gz
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.bz2
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.lz
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.xz
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.zst
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.zip
Merge branch 'development' into createWethPage
* development: (54 commits) Fix redundant spaces Fix tests Fix website unused vars Fix connect unused vars Fix 0x.js unused vars Dissallow unused vars/imports Implement first custom linter rule async-suffix Reuse intervalutils in website Add a newline Name a variable Add a comment Fix a conditional Make migrations deterministic Fix linter error Fix linter errors Add a function to init token balances Rename tokenUtils.getNonProtocolTokens to tokenUtils.getDummyTokens Add DummyToken to gitignore Add DummyToken to artifacts list Increase mocha timeout ...
Diffstat (limited to 'packages/website/ts/web3_wrapper.ts')
-rw-r--r--packages/website/ts/web3_wrapper.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/website/ts/web3_wrapper.ts b/packages/website/ts/web3_wrapper.ts
index b713f8a33..1bf7ffed5 100644
--- a/packages/website/ts/web3_wrapper.ts
+++ b/packages/website/ts/web3_wrapper.ts
@@ -1,4 +1,4 @@
-import {promisify} from '@0xproject/utils';
+import {intervalUtils, promisify} from '@0xproject/utils';
import BigNumber from 'bignumber.js';
import * as _ from 'lodash';
import {Dispatcher} from 'ts/redux/dispatcher';
@@ -9,7 +9,7 @@ export class Web3Wrapper {
private web3: Web3;
private prevNetworkId: number;
private shouldPollUserAddress: boolean;
- private watchNetworkAndBalanceIntervalId: number;
+ private watchNetworkAndBalanceIntervalId: NodeJS.Timer;
private prevUserEtherBalanceInEth: BigNumber;
private prevUserAddress: string;
constructor(dispatcher: Dispatcher, provider: Web3.Provider, networkIdIfExists: number,
@@ -98,7 +98,7 @@ export class Web3Wrapper {
let prevNodeVersion: string;
this.prevUserEtherBalanceInEth = new BigNumber(0);
this.dispatcher.updateNetworkId(this.prevNetworkId);
- this.watchNetworkAndBalanceIntervalId = window.setInterval(async () => {
+ this.watchNetworkAndBalanceIntervalId = intervalUtils.setAsyncExcludingInterval(async () => {
// Check for network state changes
const currentNetworkId = await this.getNetworkIdIfExists();
if (currentNetworkId !== this.prevNetworkId) {