From 5a0ce153ec7f432495df332b356dc41b4d4d7fd3 Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Tue, 11 Apr 2023 16:13:49 +0200
Subject: [PATCH] chore: disable sentry in dev env

---
 src/targets/browser/index.tsx | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/targets/browser/index.tsx b/src/targets/browser/index.tsx
index 89a2aa750..18f4dfa32 100644
--- a/src/targets/browser/index.tsx
+++ b/src/targets/browser/index.tsx
@@ -12,7 +12,7 @@ import CozyClient, { Client, CozyProvider } from 'cozy-client'
 import { handleOAuthResponse } from 'cozy-harvest-lib/dist/helpers/oauth'
 import { I18n, initTranslation } from 'cozy-ui/transpiled/react/I18n'
 import schema from 'doctypes'
-import { createHashHistory, History } from 'history'
+import { History, createHashHistory } from 'history'
 import { memoize } from 'lodash'
 import React from 'react'
 import { render } from 'react-dom'
@@ -77,20 +77,21 @@ const setupApp = memoize(() => {
     })
   }
 
-  Sentry.init({
-    dsn: __SENTRY_DSN__,
-    integrations: [new BrowserTracing()],
-    // Set tracesSampleRate to 1.0 to capture 100%
-    // of transactions for performance monitoring.
-    // We recommend adjusting this value in production
-    // Set to 0 for local development
-    tracesSampleRate: isLocal ? 0 : 1.0,
+  !isLocal &&
+    Sentry.init({
+      dsn: __SENTRY_DSN__,
+      integrations: [new BrowserTracing()],
+      // Set tracesSampleRate to 1.0 to capture 100%
+      // of transactions for performance monitoring.
+      // We recommend adjusting this value in production
+      // Set to 0 for local development
+      tracesSampleRate: 1.0,
 
-    // Custom settings below
-    release: client.appMetadata.version,
-    environment: development ? 'development' : 'production',
-    // cast because init is somehow missing dsn property
-  } as Sentry.BrowserOptions)
+      // Custom settings below
+      release: client.appMetadata.version,
+      environment: development ? 'development' : 'production',
+      // cast because init is somehow missing dsn property
+    } as Sentry.BrowserOptions)
 
   return { root, store, client, locale, polyglot, history, tracker }
 })
-- 
GitLab