Cleanup sentry integration (#3315)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-07-08 16:57:29 -04:00
1 parent 05b1a2fc5d
commit 77f8ea67bd
9 files changed
+78 -175

No files matched your search

+8
View File
@@ -47,6 +47,7 @@ import { WeblinkStore } from "../common/weblink-store";
import { ExtensionsStore } from "../extensions/extensions-store";
import { FilesystemProvisionerStore } from "../main/extension-filesystem";
import { ThemeStore } from "./theme.store";
import { SentryInit } from "../common/sentry";
configurePackages();
@@ -85,6 +86,13 @@ export async function bootstrap(App: AppComponent) {
ExtensionDiscovery.createInstance().init();
UserStore.createInstance();
/**
* There is no point setting up sentry before UserStore is initialized as
* `allowErrorReporting` will always be falsy.
*/
await SentryInit();
await ClusterStore.createInstance().loadInitialOnRenderer();
HotbarStore.createInstance();
ExtensionsStore.createInstance();
@@ -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 { sentryDsnIsValid } from "../../../common/vars";
import { sentryIsInitialized } from "../../../common/sentry";
enum Pages {
Application = "application",
@@ -259,7 +259,7 @@ export class Preferences extends React.Component {
<section id="telemetry">
<h2 data-testid="telemetry-header">Telemetry</h2>
{telemetryExtensions.map(this.renderExtension)}
{sentryDsnIsValid ? (
{sentryIsInitialized ? (
<React.Fragment key='sentry'>
<section id='sentry' className="small">
<SubTitle title='Automatic Error Reporting' />
-3
View File
@@ -36,9 +36,6 @@ import { registerIpcHandlers } from "./ipc";
import { ipcRenderer } from "electron";
import { IpcRendererNavigationEvents } from "./navigation/events";
import { catalogEntityRegistry } from "./api/catalog-entity-registry";
import { SentryInit } from "../common/sentry";
SentryInit();
@observer
export class LensApp extends React.Component {