Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disable virtual background feature, now hides the feature everywhere #13851

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -287,8 +293,6 @@ const VideoSettingsContent = ({
}
}, [ videoDeviceIds ]);

const virtualBackgroundSupported = checkBlurSupport();

return (
<ContextMenu
aria-labelledby = 'video-settings-button'
Expand All @@ -301,7 +305,7 @@ const VideoSettingsContent = ({
{trackData.map((data, i) => _renderPreviewEntry(data, i))}
</ContextMenuItemGroup>
<ContextMenuItemGroup>
{ virtualBackgroundSupported && <ContextMenuItem
{ visibleVirtualBackground && <ContextMenuItem
accessibilityLabel = { t('virtualBackground.title') }
icon = { IconImage }
onClick = { selectBackground }
Expand All @@ -323,7 +327,9 @@ const mapStateToProps = (state: IReduxState) => {
const { localFlipX } = state['features/base/settings'];

return {
localFlipX: Boolean(localFlipX)
localFlipX: Boolean(localFlipX),
visibleVirtualBackground: checkBlurSupport()
&& checkVirtualBackgroundEnabled(state)
};
};

Expand Down