refactor(core): adjust sentry config (#10631)

This commit is contained in:
EYHN
2025-03-05 11:18:06 +00:00
parent bb4240f6ef
commit 0015bfbaf2
9 changed files with 46 additions and 61 deletions

View File

@@ -14,7 +14,6 @@ import { registerEvents } from './events';
import { registerHandlers } from './handlers';
import { logger } from './logger';
import { registerProtocol } from './protocol';
import { isOnline } from './ui';
import { launch } from './windows-manager/launcher';
import { launchStage } from './windows-manager/stage';
@@ -38,7 +37,7 @@ if (overrideSession) {
app.setPath('sessionData', userDataPath);
}
// eslint-disable-next-line @typescript-eslint/no-var-requires
// oxlint-disable-next-line @typescript-eslint/no-var-requires
if (require('electron-squirrel-startup')) app.quit();
if (process.env.SKIP_ONBOARDING) {
@@ -97,8 +96,10 @@ if (process.env.SENTRY_RELEASE) {
transportOptions: {
maxAgeDays: 30,
maxQueueSize: 100,
shouldStore: () => !isOnline,
shouldSend: () => isOnline,
},
});
Sentry.setTags({
distribution: 'electron',
appVersion: app.getVersion(),
});
}

View File

@@ -32,8 +32,6 @@ import { getOrCreateCustomThemeWindow } from '../windows-manager/custom-theme-wi
import { getChallengeResponse } from './challenge';
import { uiSubjects } from './subject';
export let isOnline = true;
export const uiHandlers = {
isMaximized: async () => {
const window = await getMainWindow();
@@ -75,9 +73,6 @@ export const uiHandlers = {
const window = await getMainWindow();
window?.hide();
},
handleNetworkChange: async (_, _isOnline: boolean) => {
isOnline = _isOnline;
},
getChallengeResponse: async (_, challenge: string) => {
return getChallengeResponse(challenge);
},