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.
This commit is contained in:
parent
9d6e21b77b
commit
1e3e15fc72
|
@ -3,9 +3,10 @@
|
|||
import { openDialog } from '../../base/dialog';
|
||||
import { IconCrown } from '../../base/icons';
|
||||
import {
|
||||
getLocalParticipant,
|
||||
getParticipantById,
|
||||
isLocalParticipantModerator,
|
||||
isParticipantModerator
|
||||
isParticipantModerator,
|
||||
PARTICIPANT_ROLE
|
||||
} from '../../base/participants';
|
||||
import { AbstractButton } from '../../base/toolbox';
|
||||
import type { AbstractButtonProps } from '../../base/toolbox';
|
||||
|
@ -64,7 +65,11 @@ export default class AbstractGrantModeratorButton extends AbstractButton<Props,
|
|||
export function _mapStateToProps(state: Object, ownProps: Props) {
|
||||
const { participantID } = ownProps;
|
||||
|
||||
const localParticipant = getLocalParticipant(state);
|
||||
const targetParticipant = getParticipantById(state, participantID);
|
||||
|
||||
return {
|
||||
visible: isLocalParticipantModerator(state) && !isParticipantModerator(getParticipantById(state, participantID))
|
||||
visible: Boolean(localParticipant?.role === PARTICIPANT_ROLE.MODERATOR)
|
||||
&& !isParticipantModerator(targetParticipant)
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue