Skip to content

Commit

Permalink
Migrate plugin-browser
Browse files Browse the repository at this point in the history
  • Loading branch information
vilkinsons committed Aug 8, 2024
1 parent 8615c8b commit 56c35b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/plugin-browser/src/pages/shared/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const initializeSentry = () =>
enabled: !!SENTRY_DSN,
environment: ENVIRONMENT,
integrations: [
new Sentry.BrowserTracing({
Sentry.browserTracingIntegration({
// Which URLs distributed tracing is enabled for
tracePropagationTargets: ["localhost", /^https:\/\/(?:.*\.)?hash\.ai/],
}),
Expand All @@ -22,7 +22,8 @@ export const initializeSentry = () =>
});

export const setSentryUser = (user?: LocalStorage["user"] | null) => {
Sentry.configureScope((scope) => {
{
const scope = Sentry.getCurrentScope();
const sentryUser = scope.getUser();
if (!user && sentryUser) {
scope.setUser(null);
Expand All @@ -32,5 +33,5 @@ export const setSentryUser = (user?: LocalStorage["user"] | null) => {
email: user.properties.email[0],
});
}
});
}
};

0 comments on commit 56c35b9

Please sign in to comment.