Browse Source

fix(lobby) disable invite from lobby screen fix #9209 (#9417)

* fix(lobby) disable invite from lobby screen fix #9209

* fix(lobby) destructered props fix #9209

* fix(lobby) changed const name fix #9209

* fix(lobby) added empty line fix #9209
master
Calinteodor 4 years ago
parent
commit
487da8f231
No account linked to committer's email address

+ 17
- 2
react/features/base/premeeting/components/web/PreMeetingScreen.js View File

@@ -29,6 +29,11 @@ type Props = {
29 29
      */
30 30
     name?: string,
31 31
 
32
+    /**
33
+     * Indicates whether the copy url button should be shown
34
+     */
35
+    showCopyUrlButton: boolean,
36
+
32 37
     /**
33 38
      * Indicates whether the avatar should be shown when video is off
34 39
      */
@@ -77,6 +82,7 @@ export default class PreMeetingScreen extends PureComponent<Props> {
77 82
      */
78 83
     static defaultProps = {
79 84
         showAvatar: true,
85
+        showCopyUrlButton: true,
80 86
         showConferenceInfo: true
81 87
     };
82 88
 
@@ -86,8 +92,17 @@ export default class PreMeetingScreen extends PureComponent<Props> {
86 92
      * @inheritdoc
87 93
      */
88 94
     render() {
89
-        const { name, showAvatar, showConferenceInfo, title, videoMuted, videoTrack, visibleButtons } = this.props;
90
-        const showSharingButton = allowUrlSharing();
95
+        const {
96
+            name,
97
+            showAvatar,
98
+            showConferenceInfo,
99
+            showCopyUrlButton,
100
+            title,
101
+            videoMuted,
102
+            videoTrack,
103
+            visibleButtons
104
+        } = this.props;
105
+        const showSharingButton = allowUrlSharing() && showCopyUrlButton;
91 106
 
92 107
         return (
93 108
             <div

+ 11
- 1
react/features/lobby/components/AbstractLobbyScreen.js View File

@@ -3,6 +3,7 @@
3 3
 import React, { PureComponent } from 'react';
4 4
 
5 5
 import { getConferenceName } from '../../base/conference';
6
+import { getFeatureFlag, INVITE_ENABLED } from '../../base/flags';
6 7
 import { getLocalParticipant } from '../../base/participants';
7 8
 import { getFieldValue } from '../../base/react';
8 9
 import { updateSettings } from '../../base/settings';
@@ -56,6 +57,11 @@ export type Props = {
56 57
      */
57 58
     dispatch: Function,
58 59
 
60
+    /**
61
+     * Indicates whether the copy url button should be shown
62
+     */
63
+    showCopyUrlButton: boolean,
64
+
59 65
     /**
60 66
      * Function to be used to translate i18n labels.
61 67
      */
@@ -369,8 +375,11 @@ export default class AbstractLobbyScreen<P: Props = Props> extends PureComponent
369 375
 export function _mapStateToProps(state: Object): $Shape<Props> {
370 376
     const localParticipant = getLocalParticipant(state);
371 377
     const participantId = localParticipant?.id;
378
+    const inviteEnabledFlag = getFeatureFlag(state, INVITE_ENABLED, true);
379
+    const { disableInviteFunctions } = state['features/base/config'];
372 380
     const { knocking, passwordJoinFailed } = state['features/lobby'];
373 381
     const { iAmSipGateway } = state['features/base/config'];
382
+    const showCopyUrlButton = inviteEnabledFlag || !disableInviteFunctions;
374 383
 
375 384
     return {
376 385
         _knocking: knocking,
@@ -379,6 +388,7 @@ export function _mapStateToProps(state: Object): $Shape<Props> {
379 388
         _participantId: participantId,
380 389
         _participantName: localParticipant?.name,
381 390
         _passwordJoinFailed: passwordJoinFailed,
382
-        _renderPassword: !iAmSipGateway
391
+        _renderPassword: !iAmSipGateway,
392
+        showCopyUrlButton
383 393
     };
384 394
 }

+ 5
- 1
react/features/lobby/components/web/LobbyScreen.js View File

@@ -20,8 +20,12 @@ class LobbyScreen extends AbstractLobbyScreen {
20 20
      * @inheritdoc
21 21
      */
22 22
     render() {
23
+        const { showCopyUrlButton, t } = this.props;
24
+
23 25
         return (
24
-            <PreMeetingScreen title = { this.props.t(this._getScreenTitleKey()) }>
26
+            <PreMeetingScreen
27
+                showCopyUrlButton = { showCopyUrlButton }
28
+                title = { t(this._getScreenTitleKey()) }>
25 29
                 { this._renderContent() }
26 30
             </PreMeetingScreen>
27 31
         );

Loading…
Cancel
Save