diff --git a/lang/main.json b/lang/main.json index 3f9ea79a2..89d2f7301 100644 --- a/lang/main.json +++ b/lang/main.json @@ -88,7 +88,6 @@ "documentClose": "Close shared document", "sharedvideo": "Share a YouTube video", "sharescreen": "Screen share", - "sharescreenDisabled": "Screen share disabled", "stopSharedVideo": "Stop YouTube video", "fullscreen": "View / Exit full screen", "sip": "Call SIP number", diff --git a/react/features/toolbox/components/ToolboxV2.web.js b/react/features/toolbox/components/ToolboxV2.web.js index 7be927485..8b965f8f3 100644 --- a/react/features/toolbox/components/ToolboxV2.web.js +++ b/react/features/toolbox/components/ToolboxV2.web.js @@ -55,6 +55,11 @@ type Props = { */ _conference: Object, + /** + * Whether or not desktopsharing was explicitly configured to be disabled. + */ + _desktopSharingDisabledByConfig: boolean, + /** * Whether or not screensharing is initialized. */ @@ -855,6 +860,10 @@ class ToolboxV2 extends Component { * @returns {void} */ _onToolbarToggleScreenshare() { + if (!this.props._desktopSharingEnabled) { + return; + } + sendAnalytics(createShortcutEvent( 'toggle.screen.sharing', ACTION_SHORTCUT_TRIGGERED, @@ -897,20 +906,35 @@ class ToolboxV2 extends Component { } /** - * Renders a button for togglein screen sharing. + * Renders a button for toggleing screen sharing. * * @private - * @returns {ReactElement} + * @returns {ReactElement|null} */ _renderDesktopSharingButton() { - const { _desktopSharingEnabled, _screensharing, t } = this.props; + const { + _desktopSharingDisabledByConfig, + _desktopSharingEnabled, + _screensharing, + t + } = this.props; + + const disabledTooltipText + = interfaceConfig.DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP; + const showDisabledTooltip + = disabledTooltipText && _desktopSharingDisabledByConfig; + const visible = _desktopSharingEnabled || showDisabledTooltip; + + if (!visible) { + return null; + } + const classNames = `icon-share-desktop ${ _screensharing ? 'toggled' : ''} ${ _desktopSharingEnabled ? '' : 'disabled'}`; - const tooltip = _desktopSharingEnabled - ? t('toolbar.sharescreen') - : interfaceConfig.DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP - || t('toolbar.sharescreenDisabled'); + const tooltip = showDisabledTooltip + ? disabledTooltipText + : t('toolbar.sharescreen'); return (