diff --git a/.env_example b/.env_example index b8485b49..80f318c6 100644 --- a/.env_example +++ b/.env_example @@ -14,4 +14,7 @@ USE_EXTERNAL_SERVER=false DEV_SERVER_URL=http://192.168.2.20:5173 # The level of logging to use. -LOG_LEVEL=debug \ No newline at end of file +LOG_LEVEL=debug + +# Send events to Sentry +SENTRY_ENABLED=false diff --git a/.env_test_example b/.env_test_example index 94f2d29b..4f470caf 100644 --- a/.env_test_example +++ b/.env_test_example @@ -7,4 +7,7 @@ COMFY_HOST=localhost COMFY_PORT=5173 # Whether to use an external server instead of starting one locally. -USE_EXTERNAL_SERVER=true \ No newline at end of file +USE_EXTERNAL_SERVER=true + +# Send events to Sentry +SENTRY_ENABLED=false diff --git a/.prettierignore b/.prettierignore index da5dc2a5..c1a693e5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,4 @@ dist assets .vite scripts +.env_* diff --git a/src/main.ts b/src/main.ts index 5eb0a5de..76472bb1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,6 +34,7 @@ let alwaysSendCrashReports = false; Sentry.init({ dsn: SENTRY_URL_ENDPOINT, autoSessionTracking: false, + enabled: process.env.SENTRY_ENABLED === 'true' || app.isPackaged, beforeSend: async (event, hint) => { if (event.extra?.comfyUIExecutionError || alwaysSendCrashReports) { return event;