Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(breakout): Move visibility checks to the Security dialog.
damencho914ace576a91
diff --git a/react/features/lobby/components/web/LobbySection.tsx b/react/features/lobby/components/web/LobbySection.tsxindex 075dca6461..e7396a29e8 100644--- a/react/features/lobby/components/web/LobbySection.tsx+++ b/react/features/lobby/components/web/LobbySection.tsx@@ -3,11 +3,8 @@ import { WithTranslation } from 'react-i18next';import { connect } from 'react-redux';import { IReduxState, IStore } from '../../../app/types';-import { getSecurityUiConfig } from '../../../base/config/functions.any';import { translate } from '../../../base/i18n/functions';-import { isLocalParticipantModerator } from '../../../base/participants/functions';import Switch from '../../../base/ui/components/web/Switch';-import { isInBreakoutRoom } from '../../../breakout-rooms/functions';import { toggleLobbyMode } from '../../actions';interface IProps extends WithTranslation {@@ -17,11 +14,6 @@ interface IProps extends WithTranslation {*/_lobbyEnabled: boolean;- /**- * True if the section should be visible.- */- _visible: boolean;-/*** The Redux Dispatch function.*/@@ -77,11 +69,7 @@ class LobbySection extends PureComponent<IProps, IState> {* @inheritdoc*/override render() {- const { _visible, t } = this.props;-- if (!_visible) {- return null;- }+ const { t } = this.props;return (<div id = 'lobby-section'>@@ -126,13 +114,8 @@ class LobbySection extends PureComponent<IProps, IState> {* @returns {IProps}*/function mapStateToProps(state: IReduxState) {- const { conference } = state['features/base/conference'];- const { hideLobbyButton } = getSecurityUiConfig(state);-return {- _lobbyEnabled: state['features/lobby'].lobbyEnabled,- _visible: conference?.isLobbySupported() && isLocalParticipantModerator(state)- && !hideLobbyButton && !isInBreakoutRoom(state)+ _lobbyEnabled: state['features/lobby'].lobbyEnabled};}diff --git a/react/features/security/components/security-dialog/web/SecurityDialog.tsx b/react/features/security/components/security-dialog/web/SecurityDialog.tsxindex 659c7a571c..d3892bb449 100644--- a/react/features/security/components/security-dialog/web/SecurityDialog.tsx+++ b/react/features/security/components/security-dialog/web/SecurityDialog.tsx@@ -10,6 +10,7 @@ import LobbySection from '../../../../lobby/components/web/LobbySection';import { isEnablingLobbyAllowed } from '../../../../lobby/functions';import PasswordSection from './PasswordSection';+import { isInBreakoutRoom } from '../../../../breakout-rooms/functions';export interface INotifyClick {key: string;@@ -22,10 +23,16 @@ export interface INotifyClick {* @returns {React$Element<any>}*/export default function SecurityDialog() {+ const lobbySupported = useSelector((state: IReduxState) =>+ state['features/base/conference'].conference?.isLobbySupported());const e2eeSupported = useSelector((state: IReduxState) => state['features/base/conference'].e2eeSupported);- const disableLobbyPassword = useSelector((state: IReduxState) => getSecurityUiConfig(state)?.disableLobbyPassword);- const _isEnablingLobbyAllowed = useSelector(isEnablingLobbyAllowed);+ const isInBreakout = useSelector(isInBreakoutRoom);+ const disableLobbyPassword = useSelector((state: IReduxState) => getSecurityUiConfig(state)?.disableLobbyPassword)+ || isInBreakout;const isModerator = useSelector(isLocalParticipantModerator);+ const { hideLobbyButton } = useSelector(getSecurityUiConfig);+ const _isLobbyVisible = useSelector(isEnablingLobbyAllowed)+ && lobbySupported && isModerator && !isInBreakout && !hideLobbyButton;const showE2ee = Boolean(e2eeSupported) && isModerator;return (@@ -35,19 +42,19 @@ export default function SecurityDialog() {titleKey = 'security.title'><div className = 'security-dialog'>{- _isEnablingLobbyAllowed && <LobbySection />+ _isLobbyVisible && <LobbySection />}{!disableLobbyPassword && (<>- { _isEnablingLobbyAllowed && <div className = 'separator-line' /> }+ { _isLobbyVisible && <div className = 'separator-line' /> }<PasswordSection /></>)}{showE2ee ? <>- { (_isEnablingLobbyAllowed || !disableLobbyPassword) && <div className = 'separator-line' /> }+ { (_isLobbyVisible || !disableLobbyPassword) && <div className = 'separator-line' /> }<E2EESection /></> : null}