Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(menu) do not display overflow menu button if no items

Tudor-Ovidiu Avram8d3d94f568de
diff --git a/react/features/toolbox/components/web/Toolbox.js b/react/features/toolbox/components/web/Toolbox.js
index 3fd18c9cc3..6eba715045 100644
--- a/react/features/toolbox/components/web/Toolbox.js
+++ b/react/features/toolbox/components/web/Toolbox.js
@@ -1030,12 +1030,14 @@ class Toolbox extends Component<Props, State> {
key = 'fullscreen'
onClick = { this._onToolbarToggleFullScreen }
text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
- <LiveStreamButton
- key = 'livestreaming'
- showLabel = { true } />,
- <RecordButton
- key = 'record'
- showLabel = { true } />,
+ this._shouldShowButton('livestreaming')
+ && <LiveStreamButton
+ key = 'livestreaming'
+ showLabel = { true } />,
+ this._shouldShowButton('recording')
+ && <RecordButton
+ key = 'record'
+ showLabel = { true } />,
this._shouldShowButton('sharedvideo')
&& <OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.sharedvideo') }
@@ -1047,18 +1049,19 @@ class Toolbox extends Component<Props, State> {
&& <SharedDocumentButton
key = 'etherpad'
showLabel = { true } />,
- <VideoBlurButton
- key = 'videobackgroundblur'
- showLabel = { true }
- visible = { this._shouldShowButton('videobackgroundblur') && !_screensharing } />,
- <SettingsButton
- key = 'settings'
- showLabel = { true }
- visible = { this._shouldShowButton('settings') } />,
- <MuteEveryoneButton
- key = 'mute-everyone'
- showLabel = { true }
- visible = { this._shouldShowButton('mute-everyone') } />,
+ this._shouldShowButton('videobackgroundblur')
+ && <VideoBlurButton
+ key = 'videobackgroundblur'
+ showLabel = { true }
+ visible = { !_screensharing } />,
+ this._shouldShowButton('settings')
+ && <SettingsButton
+ key = 'settings'
+ showLabel = { true } />,
+ this._shouldShowButton('mute-everyone')
+ && <MuteEveryoneButton
+ key = 'mute-everyone'
+ showLabel = { true } />,
this._shouldShowButton('stats')
&& <OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
@@ -1224,7 +1227,7 @@ class Toolbox extends Component<Props, State> {
t
} = this.props;
const overflowMenuContent = this._renderOverflowMenuContent();
- const overflowHasItems = Boolean(overflowMenuContent.length);
+ const overflowHasItems = overflowMenuContent.some(item => Boolean(item));
const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
const buttonsLeft = [];
const buttonsRight = [];