diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-05 00:51:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05 00:51:17 +0800 |
commit | 5176d929fa6d3c6ce414448ea2441bd450f04e3c (patch) | |
tree | 6ea9d1f9c9506bee42dbbe0543a8c407c6c5d05e /packages/website/ts/utils/analytics.ts | |
parent | ade620f4f7d9ac1e5726681aefcbddf742915a84 (diff) | |
parent | 8adc6f0faadb46f88c1f9738b04039d037cfbcb9 (diff) | |
download | dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.tar dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.tar.gz dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.tar.bz2 dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.tar.lz dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.tar.xz dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.tar.zst dexon-sol-tools-5176d929fa6d3c6ce414448ea2441bd450f04e3c.zip |
Merge pull request #817 from 0xProject/remove-web3
Remove Web3 Dependencies (exept for in web3-wrapper)
Diffstat (limited to 'packages/website/ts/utils/analytics.ts')
-rw-r--r-- | packages/website/ts/utils/analytics.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/website/ts/utils/analytics.ts b/packages/website/ts/utils/analytics.ts index 928e45bc3..f4bfa083f 100644 --- a/packages/website/ts/utils/analytics.ts +++ b/packages/website/ts/utils/analytics.ts @@ -1,8 +1,8 @@ import * as _ from 'lodash'; import * as ReactGA from 'react-ga'; +import { InjectedWeb3 } from 'ts/types'; import { configs } from 'ts/utils/configs'; import { utils } from 'ts/utils/utils'; -import * as Web3 from 'web3'; export const analytics = { init(): void { @@ -16,11 +16,12 @@ export const analytics = { value, }); }, - async logProviderAsync(web3IfExists: Web3): Promise<void> { + async logProviderAsync(web3IfExists: InjectedWeb3): Promise<void> { await utils.onPageLoadAsync(); - const providerType = !_.isUndefined(web3IfExists) - ? utils.getProviderType(web3IfExists.currentProvider) - : 'NONE'; + const providerType = + !_.isUndefined(web3IfExists) && !_.isUndefined(web3IfExists.currentProvider) + ? utils.getProviderType(web3IfExists.currentProvider) + : 'NONE'; ReactGA.ga('set', 'dimension1', providerType); }, }; |