diff --git a/react/features/base/config/functions.any.ts b/react/features/base/config/functions.any.ts index 918b9eb7b9709..53d4c961538ae 100644 --- a/react/features/base/config/functions.any.ts +++ b/react/features/base/config/functions.any.ts @@ -381,3 +381,21 @@ export function getLegalUrls(state: IReduxState) { terms: configLegalUrls?.terms || DEFAULT_TERMS_URL }; } + +/** + * Utility function to debounce the execution of a callback function. + * + * @param {Function} callback - The callback to debounce. + * @param {number} delay - The debounce delay in milliseconds. + * @returns {Function} - A debounced function that delays the execution of the callback. + */ +export function debounce(callback: (...args: any[]) => void, delay: number) { + let timerId: any; + + return (...args: any[]) => { + if (timerId) { + clearTimeout(timerId); + } + timerId = setTimeout(() => callback(...args), delay); + }; +} diff --git a/react/features/settings/components/web/audio/AudioSettingsContent.tsx b/react/features/settings/components/web/audio/AudioSettingsContent.tsx index e29f260a0e233..d966190398282 100644 --- a/react/features/settings/components/web/audio/AudioSettingsContent.tsx +++ b/react/features/settings/components/web/audio/AudioSettingsContent.tsx @@ -281,6 +281,7 @@ const AudioSettingsContent = ({ return (