From 4e34b3b715ae6e2470c2f2d9c2a2fbc977f26566 Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Mon, 18 Jul 2022 16:07:52 +0100 Subject: [PATCH] fix: show warning only in production build --- packages/widget/src/hooks/useTelemetry.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/widget/src/hooks/useTelemetry.ts b/packages/widget/src/hooks/useTelemetry.ts index 82a092cf9..16384d239 100644 --- a/packages/widget/src/hooks/useTelemetry.ts +++ b/packages/widget/src/hooks/useTelemetry.ts @@ -5,9 +5,11 @@ import { initSentry } from '../config/sentry'; export const useTelemetry = (disabled?: boolean) => { useEffect(() => { if (disabled) { - console.warn( - 'Enable crash reports and diagnostic data to be collected. This helps us to better understand how the widget is performing and where improvements need to be made.', - ); + if (process.env.NODE_ENV === 'production') { + console.warn( + 'Enable crash reports and diagnostic data to be collected. This helps us to better understand how the widget is performing and where improvements need to be made.', + ); + } } else { initSentry(true); return () => {