diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-12-04 06:53:25 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-12-04 06:53:25 +0800 |
commit | 239116eec47482807029c14b08f2ac6bb72b47d2 (patch) | |
tree | 7137631dfe3eba620b21ba148af119fb486b34e9 /packages/instant/src/util | |
parent | 50df67e7511460f051f91785bb4384485077ef60 (diff) | |
download | dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.tar dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.tar.gz dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.tar.bz2 dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.tar.lz dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.tar.xz dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.tar.zst dexon-sol-tools-239116eec47482807029c14b08f2ac6bb72b47d2.zip |
feat(instant): have to use INSTANT_HEAP_FORCE_DEVELOPMENT to report to heap in development
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 { |