Переглянути джерело

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 роки тому
джерело
коміт
1e3e15fc72

+ 8
- 3
react/features/remote-video-menu/components/AbstractGrantModeratorButton.js Переглянути файл

@@ -3,9 +3,10 @@
3 3
 import { openDialog } from '../../base/dialog';
4 4
 import { IconCrown } from '../../base/icons';
5 5
 import {
6
+    getLocalParticipant,
6 7
     getParticipantById,
7
-    isLocalParticipantModerator,
8
-    isParticipantModerator
8
+    isParticipantModerator,
9
+    PARTICIPANT_ROLE
9 10
 } from '../../base/participants';
10 11
 import { AbstractButton } from '../../base/toolbox';
11 12
 import type { AbstractButtonProps } from '../../base/toolbox';
@@ -64,7 +65,11 @@ export default class AbstractGrantModeratorButton extends AbstractButton<Props,
64 65
 export function _mapStateToProps(state: Object, ownProps: Props) {
65 66
     const { participantID } = ownProps;
66 67
 
68
+    const localParticipant = getLocalParticipant(state);
69
+    const targetParticipant = getParticipantById(state, participantID);
70
+
67 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
 }

Завантаження…
Відмінити
Зберегти