Bläddra i källkod

fix: use consistent moderator semantics

Use the same moderator semantics when adding items into the remote video menu as when showing/hiding the items themselves.
master
Gabriel Imre 5 år sedan
förälder
incheckning
1e3e15fc72

+ 8
- 3
react/features/remote-video-menu/components/AbstractGrantModeratorButton.js Visa fil

3
 import { openDialog } from '../../base/dialog';
3
 import { openDialog } from '../../base/dialog';
4
 import { IconCrown } from '../../base/icons';
4
 import { IconCrown } from '../../base/icons';
5
 import {
5
 import {
6
+    getLocalParticipant,
6
     getParticipantById,
7
     getParticipantById,
7
-    isLocalParticipantModerator,
8
-    isParticipantModerator
8
+    isParticipantModerator,
9
+    PARTICIPANT_ROLE
9
 } from '../../base/participants';
10
 } from '../../base/participants';
10
 import { AbstractButton } from '../../base/toolbox';
11
 import { AbstractButton } from '../../base/toolbox';
11
 import type { AbstractButtonProps } from '../../base/toolbox';
12
 import type { AbstractButtonProps } from '../../base/toolbox';
64
 export function _mapStateToProps(state: Object, ownProps: Props) {
65
 export function _mapStateToProps(state: Object, ownProps: Props) {
65
     const { participantID } = ownProps;
66
     const { participantID } = ownProps;
66
 
67
 
68
+    const localParticipant = getLocalParticipant(state);
69
+    const targetParticipant = getParticipantById(state, participantID);
70
+
67
     return {
71
     return {
68
-        visible: isLocalParticipantModerator(state) && !isParticipantModerator(getParticipantById(state, participantID))
72
+        visible: Boolean(localParticipant?.role === PARTICIPANT_ROLE.MODERATOR)
73
+          && !isParticipantModerator(targetParticipant)
69
     };
74
     };
70
 }
75
 }

Laddar…
Avbryt
Spara