fix(config): use hide display name flag for dominant speaker (#10839)

This commit is contained in:
Mihaela Dumitru 2022-01-25 13:17:27 +02:00 committed by GitHub
parent 931ef75b4f
commit 49dd007167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -186,6 +186,15 @@ export function isNameReadOnly(state: Object): boolean {
|| state['features/base/config'].readOnlyName; || state['features/base/config'].readOnlyName;
} }
/**
* Selector for determining if the display name is visible.
*
* @param {Object} state - The state of the app.
* @returns {boolean}
*/
export function isDisplayNameVisible(state: Object): boolean {
return !state['features/base/config'].hideDisplayName;
}
/** /**
* Restores a Jitsi Meet config.js from {@code localStorage} if it was * Restores a Jitsi Meet config.js from {@code localStorage} if it was

View File

@ -4,6 +4,7 @@ import { makeStyles } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { isDisplayNameVisible } from '../../../base/config/functions.any';
import { getLocalParticipant } from '../../../base/participants'; import { getLocalParticipant } from '../../../base/participants';
import { withPixelLineHeight } from '../../../base/styles/functions.web'; import { withPixelLineHeight } from '../../../base/styles/functions.web';
import { getLargeVideoParticipant } from '../../../large-video/functions'; import { getLargeVideoParticipant } from '../../../large-video/functions';
@ -44,8 +45,9 @@ const DominantSpeakerName = () => {
const isTileView = useSelector(isLayoutTileView); const isTileView = useSelector(isLayoutTileView);
const toolboxVisible = useSelector(isToolboxVisible); const toolboxVisible = useSelector(isToolboxVisible);
const showDisplayName = useSelector(isDisplayNameVisible);
if (nameToDisplay && selectedId !== localId && !isTileView) { if (showDisplayName && nameToDisplay && selectedId !== localId && !isTileView) {
return ( return (
<div <div
className = { `${classes.badgeContainer}${toolboxVisible ? '' : ` ${classes.containerElevated}`}` }> className = { `${classes.badgeContainer}${toolboxVisible ? '' : ` ${classes.containerElevated}`}` }>

View File

@ -4,7 +4,7 @@ import { makeStyles } from '@material-ui/styles';
import React from 'react'; import React from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { isNameReadOnly } from '../../../base/config/functions.any'; import { isDisplayNameVisible, isNameReadOnly } from '../../../base/config/functions.any';
import DisplayName from '../../../display-name/components/web/DisplayName'; import DisplayName from '../../../display-name/components/web/DisplayName';
import { LAYOUTS } from '../../../video-layout'; import { LAYOUTS } from '../../../video-layout';
@ -63,7 +63,7 @@ const ThumbnailBottomIndicators = ({
const styles = useStyles(); const styles = useStyles();
const _allowEditing = !useSelector(isNameReadOnly); const _allowEditing = !useSelector(isNameReadOnly);
const _defaultLocalDisplayName = interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME; const _defaultLocalDisplayName = interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME;
const _showDisplayName = useSelector(state => !state['features/base/config'].hideDisplayName); const _showDisplayName = useSelector(isDisplayNameVisible);
return (<div className = { className }> return (<div className = { className }>
<StatusIndicators <StatusIndicators