diff --git a/src/common/sentry.ts b/src/common/sentry.ts index e8462ffc2f..36435b86c9 100644 --- a/src/common/sentry.ts +++ b/src/common/sentry.ts @@ -24,6 +24,8 @@ import { sentryDsn, isProduction } from "./vars"; import { UserStore } from "./user-store"; import logger from "../main/logger"; +export let sentryIsInitialized = false; + /** * This function bypasses webpack issues. * @@ -77,6 +79,9 @@ export async function SentryInit(): Promise { }, environment: isProduction ? "production" : "development", }); + + sentryIsInitialized = true; + logger.info(`✔️ [SENTRY-INIT]: Sentry for ${process.type} is initialized.`); } catch (error) { logger.warn(`⚠️ [SENTRY-INIT]: Sentry.init() error: ${error?.message ?? error}.`); diff --git a/src/renderer/components/+preferences/preferences.tsx b/src/renderer/components/+preferences/preferences.tsx index 6e9ae5f210..285c9b2c75 100644 --- a/src/renderer/components/+preferences/preferences.tsx +++ b/src/renderer/components/+preferences/preferences.tsx @@ -41,7 +41,7 @@ import { FormSwitch, Switcher } from "../switch"; import { KubeconfigSyncs } from "./kubeconfig-syncs"; import { SettingLayout } from "../layout/setting-layout"; import { Checkbox } from "../checkbox"; -import { sentryDsn } from "../../../common/vars"; +import { sentryIsInitialized } from "../../../common/sentry"; enum Pages { Application = "application", @@ -259,7 +259,7 @@ export class Preferences extends React.Component {

Telemetry

{telemetryExtensions.map(this.renderExtension)} - {sentryDsn ? ( + {sentryIsInitialized ? (