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
feat(prejoin): Hide invite link
Hristo Terezov5e4b8c747c56
diff --git a/react/features/prejoin/components/Prejoin.js b/react/features/prejoin/components/Prejoin.jsindex 58fa83d791..01fa5b8f65 100644--- a/react/features/prejoin/components/Prejoin.js+++ b/react/features/prejoin/components/Prejoin.js@@ -11,6 +11,7 @@ import { ActionButton, InputField, PreMeetingScreen, ToggleButton } from '../../import { connect } from '../../base/redux';import { getDisplayName, updateSettings } from '../../base/settings';import { getLocalJitsiVideoTrack } from '../../base/tracks';+import { isButtonEnabled } from '../../toolbox/functions.web';import {joinConference as joinConferenceAction,joinConferenceWithoutAudio as joinConferenceWithoutAudioAction,@@ -28,6 +29,8 @@ import {import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';import DeviceStatus from './preview/DeviceStatus';+declare var interfaceConfig: Object;+type Props = {/**@@ -100,6 +103,11 @@ type Props = {*/showJoinActions: boolean,+ /**+ * Flag signaling the visibility of the conference URL section.+ */+ showConferenceInfo: boolean,+/*** If 'JoinByPhoneDialog' is visible or not.*/@@ -139,6 +147,7 @@ class Prejoin extends Component<Props, State> {* @static*/static defaultProps = {+ showConferenceInfo: true,showJoinActions: true,showSkipPrejoin: true};@@ -257,6 +266,7 @@ class Prejoin extends Component<Props, State> {showAvatar,showCameraPreview,showDialog,+ showConferenceInfo,showJoinActions,t,videoTrack@@ -270,7 +280,7 @@ class Prejoin extends Component<Props, State> {footer = { this._renderFooter() }name = { name }showAvatar = { showAvatar }- showConferenceInfo = { showJoinActions }+ showConferenceInfo = { showConferenceInfo }skipPrejoinButton = { this._renderSkipPrejoinButton() }title = { t('prejoin.joinMeeting') }videoMuted = { !showCameraPreview }@@ -368,11 +378,22 @@ class Prejoin extends Component<Props, State> {* Maps (parts of) the redux state to the React {@code Component} props.** @param {Object} state - The redux state.+ * @param {Object} ownProps - The props passed to the component.* @returns {Object}*/-function mapStateToProps(state): Object {+function mapStateToProps(state, ownProps): Object {const name = getDisplayName(state);const joinButtonDisabled = isDisplayNameRequired(state) && !name;+ const { showJoinActions } = ownProps;+ const isInviteButtonEnabled = isButtonEnabled('invite');++ // Hide conference info when interfaceConfig is available and the invite button is disabled.+ // In all other cases we want to preserve the behaviour and control the the conference info+ // visibility trough showJoinActions.+ const showConferenceInfo+ = typeof isInviteButtonEnabled === 'undefined' || isInviteButtonEnabled === true+ ? showJoinActions+ : false;return {buttonIsToggled: isPrejoinSkipped(state),@@ -383,6 +404,7 @@ function mapStateToProps(state): Object {showDialog: isJoinByPhoneDialogVisible(state),hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),showCameraPreview: !isVideoMutedByUser(state),+ showConferenceInfo,videoTrack: getLocalJitsiVideoTrack(state)};}diff --git a/react/features/toolbox/functions.web.js b/react/features/toolbox/functions.web.jsindex 3f3f870533..95aa0bd35f 100644--- a/react/features/toolbox/functions.web.js+++ b/react/features/toolbox/functions.web.js@@ -21,11 +21,16 @@ export function getToolboxHeight() {** @param {string} name - The name of the setting section as defined in* interface_config.js.- * @returns {boolean} - True to indicate that the given toolbar button- * is enabled, false - otherwise.+ * @returns {boolean|undefined} - True to indicate that the given toolbar button+ * is enabled, false - otherwise. In cases where interfaceConfig is not available+ * undefined is returned.*/export function isButtonEnabled(name: string) {- return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;+ if (typeof interfaceConfig === 'object' && Array.isArray(interfaceConfig.TOOLBAR_BUTTONS)) {+ return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;+ }++ return undefined;}