Skip to content

Commit

Permalink
fix: show warning only in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Jul 18, 2022
1 parent fbbe270 commit 4e34b3b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/widget/src/hooks/useTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 4e34b3b

Please sign in to comment.