1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/start-main-application/runnables/setup-sentry.injectable.ts
Sebastian Malton 3df3ecd2f6 Fix not starting with sentryDSN configured
- Make sure that all beforeElectronIsReady runables are run completely
  syncronously

- Fix when setupSentry is to be run (namely before electron is ready)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-06-14 16:30:09 -04:00

25 lines
722 B
TypeScript

/**
* 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 { initializeSentryReporting } from "../../../common/sentry";
import { init } from "@sentry/electron/main";
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
const setupSentryInjectable = getInjectable({
id: "setup-sentry",
instantiate: () => ({
run: () => {
initializeSentryReporting(init);
},
}),
causesSideEffects: true,
injectionToken: beforeElectronIsReadyInjectionToken,
});
export default setupSentryInjectable;