diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-02 04:31:43 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-02 05:50:55 +0800 |
commit | a6f40d418704a8dca8c787663f00b6bcbdf18ba4 (patch) | |
tree | 8da4c0c480df8d200b0a39e7945787e95953b1e8 /packages/website/ts/blockchain_watcher.ts | |
parent | 6daf754f5bb4aa85d0f65bfdaf8910db4401d1cc (diff) | |
download | dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.tar dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.tar.gz dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.tar.bz2 dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.tar.lz dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.tar.xz dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.tar.zst dexon-sol-tools-a6f40d418704a8dca8c787663f00b6bcbdf18ba4.zip |
Implement correct behavior for menu in the wallet
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); } |