diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-12-04 09:52:44 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-12-04 09:52:44 +0800 |
commit | d12b99883bbf73575cd2e14ebba98b1ea1934004 (patch) | |
tree | 784592d5a7d9034496cfedafa1732d5046d5af8c /packages/instant/src/util | |
parent | 1498e013d083ed3815f5d5ea2de93a848161ed07 (diff) | |
parent | a1e985a1cac46ecbc54c7ef5b846fb5faf2bede2 (diff) | |
download | dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.tar dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.tar.gz dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.tar.bz2 dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.tar.lz dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.tar.xz dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.tar.zst dexon-0x-contracts-d12b99883bbf73575cd2e14ebba98b1ea1934004.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/website/instant-configurator
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index e625824ef..760ec8b5c 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -2,7 +2,7 @@ import { BuyQuote } from '@0x/asset-buyer'; import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; -import { INSTANT_DISCHARGE_TARGET } from '../constants'; +import { HEAP_ENABLED, INSTANT_DISCHARGE_TARGET } from '../constants'; import { AffiliateInfo, Asset, @@ -16,15 +16,17 @@ import { import { EventProperties, heapUtil } from './heap'; -let isDisabled = false; +let isDisabledViaConfig = false; export const disableAnalytics = (shouldDisableAnalytics: boolean) => { - isDisabled = shouldDisableAnalytics; + isDisabledViaConfig = shouldDisableAnalytics; }; export const evaluateIfEnabled = (fnCall: () => void) => { - if (isDisabled) { + if (isDisabledViaConfig) { return; } - fnCall(); + if (HEAP_ENABLED) { + fnCall(); + } }; enum EventNames { |