From 450814ad80bb22332579e8ba54b58e1c06f34f71 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Thu, 15 Nov 2018 11:28:44 -0800 Subject: Introduce ANALYTICS_ENABLED constant --- packages/instant/src/constants.ts | 1 + packages/instant/src/util/analytics.ts | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'packages/instant/src') 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 { -- cgit