瀏覽代碼

fix(toolbar): do not show invite button if features not available

This is instead of showing the button with a tooltip about it
being disabled.
master
Leonard Kim 7 年之前
父節點
當前提交
0a086fa3f7
共有 1 個文件被更改,包括 20 次插入10 次删除
  1. 20
    10
      react/features/toolbox/components/ToolboxV2.web.js

+ 20
- 10
react/features/toolbox/components/ToolboxV2.web.js 查看文件

91
      */
91
      */
92
     _fullScreen: boolean,
92
     _fullScreen: boolean,
93
 
93
 
94
+    /**
95
+     * Whether or not invite should be hidden, regardless of feature
96
+     * availability.
97
+     */
98
+    _hideInviteButton: boolean,
99
+
94
     /**
100
     /**
95
      * Whether or not the conference is currently being recorded by the local
101
      * Whether or not the conference is currently being recorded by the local
96
      * participant.
102
      * participant.
299
      */
305
      */
300
     render() {
306
     render() {
301
         const {
307
         const {
302
-            _addPeopleAvailable,
303
             _chatOpen,
308
             _chatOpen,
304
-            _dialOutAvailable,
309
+            _hideInviteButton,
305
             _raisedHand,
310
             _raisedHand,
306
             _visible,
311
             _visible,
307
             t
312
             t
349
                 </div>
354
                 </div>
350
                 <div className = 'button-group-right'>
355
                 <div className = 'button-group-right'>
351
                     { this._shouldShowButton('invite')
356
                     { this._shouldShowButton('invite')
357
+                        && !_hideInviteButton
352
                         && <ToolbarButtonV2
358
                         && <ToolbarButtonV2
353
                             iconName = 'icon-add'
359
                             iconName = 'icon-add'
354
                             onClick = { this._onToolbarOpenInvite }
360
                             onClick = { this._onToolbarOpenInvite }
355
-                            tooltip = { _addPeopleAvailable || _dialOutAvailable
356
-                                ? t('addPeople.title')
357
-                                : t('addPeople.notAvailable') } /> }
361
+                            tooltip = { t('addPeople.title') } /> }
358
                     { this._shouldShowButton('info') && <InfoDialogButton /> }
362
                     { this._shouldShowButton('info') && <InfoDialogButton /> }
359
                     { overflowHasItems
363
                     { overflowHasItems
360
                         && <OverflowMenuButton
364
                         && <OverflowMenuButton
1070
     const {
1074
     const {
1071
         callStatsID,
1075
         callStatsID,
1072
         enableRecording,
1076
         enableRecording,
1073
-        enableUserRolesBasedOnToken
1077
+        enableUserRolesBasedOnToken,
1078
+        iAmRecorder
1074
     } = state['features/base/config'];
1079
     } = state['features/base/config'];
1075
     const { isGuest } = state['features/base/jwt'];
1080
     const { isGuest } = state['features/base/jwt'];
1076
     const { isRecording, recordingType } = state['features/recording'];
1081
     const { isRecording, recordingType } = state['features/recording'];
1085
     const localParticipant = getLocalParticipant(state);
1090
     const localParticipant = getLocalParticipant(state);
1086
     const localVideo = getLocalVideoTrack(state['features/base/tracks']);
1091
     const localVideo = getLocalVideoTrack(state['features/base/tracks']);
1087
     const isModerator = localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
1092
     const isModerator = localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
1093
+    const isAddPeopleAvailable = !isGuest;
1094
+    const isDialOutAvailable
1095
+        = isModerator
1096
+            && conference && conference.isSIPCallingSupported()
1097
+            && (!enableUserRolesBasedOnToken || !isGuest);
1088
 
1098
 
1089
     return {
1099
     return {
1090
-        _addPeopleAvailable: !isGuest,
1100
+        _addPeopleAvailable: isAddPeopleAvailable,
1091
         _chatOpen: current === 'chat_container',
1101
         _chatOpen: current === 'chat_container',
1092
         _conference: conference,
1102
         _conference: conference,
1093
         _desktopSharingEnabled: desktopSharingEnabled,
1103
         _desktopSharingEnabled: desktopSharingEnabled,
1094
-        _dialOutAvailable: isModerator
1095
-            && conference && conference.isSIPCallingSupported()
1096
-            && (!enableUserRolesBasedOnToken || !isGuest),
1104
+        _dialOutAvailable: isDialOutAvailable,
1097
         _dialog: Boolean(state['features/base/dialog'].component),
1105
         _dialog: Boolean(state['features/base/dialog'].component),
1098
         _editingDocument: Boolean(state['features/etherpad'].editing),
1106
         _editingDocument: Boolean(state['features/etherpad'].editing),
1099
         _etherpadInitialized: Boolean(state['features/etherpad'].initialized),
1107
         _etherpadInitialized: Boolean(state['features/etherpad'].initialized),
1100
         _feedbackConfigured: Boolean(callStatsID),
1108
         _feedbackConfigured: Boolean(callStatsID),
1109
+        _hideInviteButton: iAmRecorder
1110
+            || (!isAddPeopleAvailable && !isDialOutAvailable),
1101
         _isRecording: isRecording,
1111
         _isRecording: isRecording,
1102
         _fullScreen: fullScreen,
1112
         _fullScreen: fullScreen,
1103
         _localParticipantID: localParticipant.id,
1113
         _localParticipantID: localParticipant.id,

Loading…
取消
儲存