diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-05 06:38:15 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-05 06:38:15 +0800 |
commit | a0b9c7777b2171456a19aa6ddcf2a023b663a816 (patch) | |
tree | b9cf9fe6d0030bf0e2591d3facccf38ff2d622c6 /packages/website/ts/blockchain_watcher.ts | |
parent | 5204e4c08da7d32012047ee6ca4d898b0c45a47d (diff) | |
parent | 5176d929fa6d3c6ce414448ea2441bd450f04e3c (diff) | |
download | dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.gz dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.bz2 dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.lz dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.xz dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.tar.zst dexon-sol-tools-a0b9c7777b2171456a19aa6ddcf2a023b663a816.zip |
merge v2-prototype
Diffstat (limited to 'packages/website/ts/blockchain_watcher.ts')
-rw-r--r-- | packages/website/ts/blockchain_watcher.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/website/ts/blockchain_watcher.ts b/packages/website/ts/blockchain_watcher.ts index df5f73fd1..4b23aa98a 100644 --- a/packages/website/ts/blockchain_watcher.ts +++ b/packages/website/ts/blockchain_watcher.ts @@ -10,6 +10,7 @@ export class BlockchainWatcher { private _watchBalanceIntervalId: NodeJS.Timer; private _prevUserEtherBalanceInWei?: BigNumber; private _prevUserAddressIfExists: string; + private _prevNodeVersionIfExists: string; constructor(dispatcher: Dispatcher, web3Wrapper: Web3Wrapper, shouldPollUserAddress: boolean) { this._dispatcher = dispatcher; this._shouldPollUserAddress = shouldPollUserAddress; @@ -43,11 +44,9 @@ export class BlockchainWatcher { ); } private async _updateBalanceAsync(): Promise<void> { - let prevNodeVersion: string; - // Check for node version changes const currentNodeVersion = await this._web3Wrapper.getNodeVersionAsync(); - if (currentNodeVersion !== prevNodeVersion) { - prevNodeVersion = currentNodeVersion; + if (this._prevNodeVersionIfExists !== currentNodeVersion) { + this._prevNodeVersionIfExists = currentNodeVersion; this._dispatcher.updateNodeVersion(currentNodeVersion); } |