diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-16 03:28:44 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-16 03:28:44 +0800 |
commit | 450814ad80bb22332579e8ba54b58e1c06f34f71 (patch) | |
tree | d21c1244a3ef02f31eb0e7f5f55447c695fda511 /packages/instant | |
parent | 0a38bf8fd6d2b98a84671a152cc380458d2e5e7e (diff) | |
download | dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.tar dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.tar.gz dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.tar.bz2 dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.tar.lz dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.tar.xz dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.tar.zst dexon-sol-tools-450814ad80bb22332579e8ba54b58e1c06f34f71.zip |
Introduce ANALYTICS_ENABLED constant
Diffstat (limited to 'packages/instant')
-rw-r--r-- | packages/instant/src/constants.ts | 1 | ||||
-rw-r--r-- | packages/instant/src/util/analytics.ts | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts index 994be9788..f46b0ca21 100644 --- a/packages/instant/src/constants.ts +++ b/packages/instant/src/constants.ts @@ -16,6 +16,7 @@ export const BUY_QUOTE_UPDATE_INTERVAL_TIME_MS = ONE_SECOND_MS * 15; export const DEFAULT_GAS_PRICE = GWEI_IN_WEI.mul(6); export const DEFAULT_ESTIMATED_TRANSACTION_TIME_MS = ONE_MINUTE_MS * 2; export const ETH_GAS_STATION_API_BASE_URL = 'https://ethgasstation.info'; +export const ANALYTICS_ENABLED = true; // TODO: change when we can switch on dev export const HEAP_ANALYTICS_DEVELOPMENT_APP_ID = '507265531'; export const COINBASE_API_BASE_URL = 'https://api.coinbase.com/v2'; export const PROGRESS_STALL_AT_WIDTH = '95%'; diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index 3e2a996cf..6b6115abe 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -1,9 +1,15 @@ import { ObjectMap } from '@0x/types'; import { logUtils } from '@0x/utils'; +import { ANALYTICS_ENABLED } from '../constants'; + import { HeapAnalytics, heapUtil } from './heap'; const evaluteHeapCall = (heapFunctionCall: (heap: HeapAnalytics) => void): void => { + if (!ANALYTICS_ENABLED) { + return; + } + const curHeap = heapUtil.getHeap(); if (curHeap) { try { |