Skip to content

Commit

Permalink
fix: use consistent moderator semantics
Browse files Browse the repository at this point in the history
Use the same moderator semantics when adding items into the remote video menu as when showing/hiding the items themselves.
  • Loading branch information
Gabriel Imre authored and saghul committed Jul 22, 2020
1 parent 9d6e21b commit 1e3e15f
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -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';
Expand Down Expand Up @@ -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)
};
}

0 comments on commit 1e3e15f

Please sign in to comment.