Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Some random code fixes by biome #485

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions packages/electron/src/electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ async function askForPermissionToSendToSentry(event: Sentry.Event, hint?: Sentry
showErrorMessage();
if (store.get('sentry-enabled') === false) {
return null;
} else if (store.get('sentry-enabled') === true) {
if (hint && hint.attachments && hint.attachments.length > 0) {
}
if (store.get('sentry-enabled') === true) {
if (hint?.attachments && hint.attachments.length > 0) {
return askToSendEnvelope(event, hint);
}
return event;
Expand All @@ -295,19 +296,20 @@ async function askForPermissionToSendToSentry(event: Sentry.Event, hint?: Sentry
if (response === 1) {
store.set('sentry-enabled', false);
return null;
} else {
store.set('sentry-enabled', true);
if (hint && hint.attachments && hint.attachments.length > 0) {
return askToSendEnvelope(event, hint);
}
return event;
}

store.set('sentry-enabled', true);
if (hint?.attachments && hint.attachments.length > 0) {
return askToSendEnvelope(event, hint);
}
return event;
}

async function askToSendEnvelope(event: Sentry.Event, hint?: Sentry.EventHint) {
if (store.get('sentry-send-envelopes') === false) {
return null;
} else if (store.get('sentry-send-envelopes') === true) {
}
if (store.get('sentry-send-envelopes') === true) {
return event;
}

Expand All @@ -316,22 +318,22 @@ async function askToSendEnvelope(event: Sentry.Event, hint?: Sentry.EventHint) {
buttons: ['Yes', 'No'],
title: 'Spotlight',
message: 'Can we also send the payload Spotlight received so we can fully reproduce the error?',
detail: 'Again, just makes things eaiser for us. (Can be changed in the settings menu)',
detail: 'Again, just makes things easier for us. (Can be changed in the settings menu)',
});

if (response === 1) {
Sentry.configureScope(scope => {
scope.clearAttachments();
});
if (hint && hint.attachments && hint.attachments.length > 0) {
if (hint?.attachments && hint.attachments.length > 0) {
hint.attachments = [];
}
store.set('sentry-send-envelopes', false);
return event;
} else {
store.set('sentry-send-envelopes', true);
return event;
}

store.set('sentry-send-envelopes', true);
return event;
}

function storeIncomingPayload(body: string) {
Expand Down
Loading