mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cleanup sentry init runnable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
3b9a72b602
commit
83334fe5bf
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getGlobalOverride } from "../../../../common/test-utils/get-global-override";
|
||||
import initializeSentryOnMainInjectable from "./initialize-on-main.injectable";
|
||||
|
||||
export default getGlobalOverride(initializeSentryOnMainInjectable, () => () => {});
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { init } from "@sentry/electron/main";
|
||||
|
||||
const initializeSentryOnMainInjectable = getInjectable({
|
||||
id: "initialize-sentry-on-main",
|
||||
instantiate: () => init,
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
export default initializeSentryOnMainInjectable;
|
||||
@ -3,17 +3,18 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { init } from "@sentry/electron/main";
|
||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
||||
import initializeSentryReportingWithInjectable from "../../../common/error-reporting/initialize-sentry-reporting.injectable";
|
||||
import { beforeElectronIsReadyInjectionToken } from "../../runnable-tokens/before-electron-is-ready-injection-token";
|
||||
import initializeSentryReportingWithInjectable from "../../../../common/error-reporting/initialize-sentry-reporting.injectable";
|
||||
import initializeSentryOnMainInjectable from "./initialize-on-main.injectable";
|
||||
|
||||
const setupSentryInjectable = getInjectable({
|
||||
id: "setup-sentry",
|
||||
instantiate: (di) => {
|
||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||
const initializeSentryOnMain = di.inject(initializeSentryOnMainInjectable);
|
||||
|
||||
return {
|
||||
run: () => initializeSentryReportingWith(init),
|
||||
run: () => initializeSentryReportingWith(initializeSentryOnMain),
|
||||
};
|
||||
},
|
||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||
Loading…
Reference in New Issue
Block a user