From fc4859f103aa44a3c81692ce139df2a528588517 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 7 May 2024 09:17:49 +0200 Subject: [PATCH] fix(feedback): Pick user from any scope --- packages/feedback/src/modal/integration.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/feedback/src/modal/integration.tsx b/packages/feedback/src/modal/integration.tsx index 02a6597f97e1..cf5048c53619 100644 --- a/packages/feedback/src/modal/integration.tsx +++ b/packages/feedback/src/modal/integration.tsx @@ -1,4 +1,4 @@ -import { getCurrentScope } from '@sentry/core'; +import { getCurrentScope, getGlobalScope, getIsolationScope } from '@sentry/core'; import type { CreateDialogProps, FeedbackFormData, FeedbackModalIntegration, IntegrationFn } from '@sentry/types'; import { h, render } from 'preact'; import { DOCUMENT } from '../constants'; @@ -13,8 +13,7 @@ export const feedbackModalIntegration = ((): FeedbackModalIntegration => { createDialog: ({ options, screenshotIntegration, sendFeedback, shadow }: CreateDialogProps) => { const shadowRoot = shadow as unknown as ShadowRoot; const userKey = options.useSentryUser; - const scope = getCurrentScope(); - const user = scope && scope.getUser(); + const user = getCurrentScope().getUser() || getIsolationScope().getUser() || getGlobalScope().getUser(); const el = DOCUMENT.createElement('div'); const style = createDialogStyles();