From 2952d1cde8a647c1725c7b532ac24c27fc6bc3a6 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 20 Sep 2023 14:25:37 +0200 Subject: [PATCH] Fix disable virtual background feature, now hides the feature everywhere --- .../web/video/VideoSettingsContent.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/react/features/settings/components/web/video/VideoSettingsContent.tsx b/react/features/settings/components/web/video/VideoSettingsContent.tsx index c647f44665..b69d0be161 100644 --- a/react/features/settings/components/web/video/VideoSettingsContent.tsx +++ b/react/features/settings/components/web/video/VideoSettingsContent.tsx @@ -13,7 +13,7 @@ import Checkbox from '../../../../base/ui/components/web/Checkbox'; import ContextMenu from '../../../../base/ui/components/web/ContextMenu'; import ContextMenuItem from '../../../../base/ui/components/web/ContextMenuItem'; import ContextMenuItemGroup from '../../../../base/ui/components/web/ContextMenuItemGroup'; -import { checkBlurSupport } from '../../../../virtual-background/functions'; +import { checkBlurSupport, checkVirtualBackgroundEnabled } from '../../../../virtual-background/functions'; import { openSettingsDialog } from '../../../actions'; import { SETTINGS_TABS } from '../../../constants'; import { createLocalVideoTracks } from '../../../functions.web'; @@ -57,6 +57,11 @@ export interface IProps { * All the camera device ids currently connected. */ videoDeviceIds: string[]; + + /** + * Whether or not the virtual background is visible. + */ + visibleVirtualBackground: boolean; } const useStyles = makeStyles()(theme => { @@ -145,7 +150,8 @@ const VideoSettingsContent = ({ selectBackground, setVideoInputDevice, toggleVideoSettings, - videoDeviceIds + videoDeviceIds, + visibleVirtualBackground }: IProps) => { const _componentWasUnmounted = useRef(false); const [ trackData, setTrackData ] = useState(new Array(videoDeviceIds.length).fill({ @@ -287,8 +293,6 @@ const VideoSettingsContent = ({ } }, [ videoDeviceIds ]); - const virtualBackgroundSupported = checkBlurSupport(); - return ( _renderPreviewEntry(data, i))} - { virtualBackgroundSupported && { const { localFlipX } = state['features/base/settings']; return { - localFlipX: Boolean(localFlipX) + localFlipX: Boolean(localFlipX), + visibleVirtualBackground: checkBlurSupport() + && checkVirtualBackgroundEnabled(state) }; };