From 1b8a735aa3d5d40258e9299521086d4c7e06db57 Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 5 Nov 2025 13:27:43 -0600 Subject: [PATCH] fix(dialog): Fixes the friendly dialog name. --- react/features/base/dialog/actions.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/react/features/base/dialog/actions.ts b/react/features/base/dialog/actions.ts index e3b18e9906..0ab564e155 100644 --- a/react/features/base/dialog/actions.ts +++ b/react/features/base/dialog/actions.ts @@ -119,8 +119,16 @@ function getComponentDisplayName(component?: ComponentType) { return ''; } - const name = component.displayName ?? component.name ?? 'Component'; + // Try to unwrap HOCs to get the actual component + let unwrapped: any = component; - return name.replace('withI18nextTranslation(Connect(', '') // dialogs with translations - .replace('))', ''); // dialogs with translations suffix + // Redux connect() stores the wrapped component in WrappedComponent + while (unwrapped.WrappedComponent) { + unwrapped = unwrapped.WrappedComponent; + } + + // Get the name from the unwrapped component + const name = unwrapped.displayName ?? unwrapped.name ?? 'Component'; + + return name; }