Skip to content

Commit 3804ff0

Browse files
authored
fix(feedback): Pick user from any scope (#11928)
The user can be set on any scope, we should pick it correctly from wherever it is set.
1 parent 9eeb148 commit 3804ff0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/feedback/src/modal/integration.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCurrentScope } from '@sentry/core';
1+
import { getCurrentScope, getGlobalScope, getIsolationScope } from '@sentry/core';
22
import type { CreateDialogProps, FeedbackFormData, FeedbackModalIntegration, IntegrationFn } from '@sentry/types';
33
import { h, render } from 'preact';
44
import { DOCUMENT } from '../constants';
@@ -13,8 +13,7 @@ export const feedbackModalIntegration = ((): FeedbackModalIntegration => {
1313
createDialog: ({ options, screenshotIntegration, sendFeedback, shadow }: CreateDialogProps) => {
1414
const shadowRoot = shadow as unknown as ShadowRoot;
1515
const userKey = options.useSentryUser;
16-
const scope = getCurrentScope();
17-
const user = scope && scope.getUser();
16+
const user = getCurrentScope().getUser() || getIsolationScope().getUser() || getGlobalScope().getUser();
1817

1918
const el = DOCUMENT.createElement('div');
2019
const style = createDialogStyles();

0 commit comments

Comments
 (0)