Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(dialog): Adds a print when opening and hiding dialogs.

damencho1b7668bbdc14
diff --git a/react/features/base/dialog/actions.ts b/react/features/base/dialog/actions.ts
index 65a0563ed7..e3b18e9906 100644
--- a/react/features/base/dialog/actions.ts
+++ b/react/features/base/dialog/actions.ts
@@ -9,6 +9,7 @@ import {
OPEN_SHEET
} from './actionTypes';
import { isDialogOpen } from './functions';
+import logger from './logger';
/**
* Signals Dialog to close its dialog.
@@ -23,6 +24,8 @@ import { isDialogOpen } from './functions';
* }}
*/
export function hideDialog(component?: ComponentType<any>) {
+ logger.info(`Hide dialog: ${getComponentDisplayName(component)}`);
+
return {
type: HIDE_DIALOG,
component
@@ -55,6 +58,8 @@ export function hideSheet() {
* }}
*/
export function openDialog(component: ComponentType<any>, componentProps?: Object) {
+ logger.info(`Open dialog: ${getComponentDisplayName(component)}`);
+
return {
type: OPEN_DIALOG,
component,
@@ -101,3 +106,21 @@ export function toggleDialog(component: ComponentType<any>, componentProps?: Obj
}
};
}
+
+/**
+ * Extracts a printable name for a dialog component.
+ *
+ * @param {Object} component - The component to extract the name for.
+ *
+ * @returns {string} The display name.
+ */
+function getComponentDisplayName(component?: ComponentType<any>) {
+ if (!component) {
+ return '';
+ }
+
+ const name = component.displayName ?? component.name ?? 'Component';
+
+ return name.replace('withI18nextTranslation(Connect(', '') // dialogs with translations
+ .replace('))', ''); // dialogs with translations suffix
+}