fix(toolbox) fix displaying mute everyone buttons for non-moderators
This commit is contained in:
parent
fe22e33343
commit
47c9e14155
|
@ -4,7 +4,7 @@ import { createToolbarEvent, sendAnalytics } from '../../analytics';
|
|||
import { openDialog } from '../../base/dialog';
|
||||
import { translate } from '../../base/i18n';
|
||||
import { IconMuteEveryone } from '../../base/icons';
|
||||
import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
|
||||
import { getLocalParticipant, isLocalParticipantModerator } from '../../base/participants';
|
||||
import { connect } from '../../base/redux';
|
||||
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
|
||||
import { MuteEveryoneDialog } from '../../video-menu/components';
|
||||
|
@ -16,11 +16,6 @@ type Props = AbstractButtonProps & {
|
|||
*/
|
||||
dispatch: Function,
|
||||
|
||||
/*
|
||||
** Whether the local participant is a moderator or not.
|
||||
*/
|
||||
isModerator: Boolean,
|
||||
|
||||
/**
|
||||
* The ID of the local participant.
|
||||
*/
|
||||
|
@ -61,14 +56,12 @@ class MuteEveryoneButton extends AbstractButton<Props, *> {
|
|||
*/
|
||||
function _mapStateToProps(state: Object, ownProps: Props) {
|
||||
const localParticipant = getLocalParticipant(state);
|
||||
const isModerator = localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
|
||||
const { visible } = ownProps;
|
||||
const { disableRemoteMute } = state['features/base/config'];
|
||||
const { visible = isLocalParticipantModerator(state) && !disableRemoteMute } = ownProps;
|
||||
|
||||
return {
|
||||
isModerator,
|
||||
localParticipantId: localParticipant.id,
|
||||
visible: visible && isModerator && !disableRemoteMute
|
||||
visible
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { createToolbarEvent, sendAnalytics } from '../../analytics';
|
|||
import { openDialog } from '../../base/dialog';
|
||||
import { translate } from '../../base/i18n';
|
||||
import { IconMuteVideoEveryone } from '../../base/icons';
|
||||
import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
|
||||
import { getLocalParticipant, isLocalParticipantModerator } from '../../base/participants';
|
||||
import { connect } from '../../base/redux';
|
||||
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
|
||||
import { MuteEveryonesVideoDialog } from '../../video-menu/components';
|
||||
|
@ -16,11 +16,6 @@ type Props = AbstractButtonProps & {
|
|||
*/
|
||||
dispatch: Function,
|
||||
|
||||
/*
|
||||
** Whether the local participant is a moderator or not.
|
||||
*/
|
||||
isModerator: Boolean,
|
||||
|
||||
/**
|
||||
* The ID of the local participant.
|
||||
*/
|
||||
|
@ -61,14 +56,12 @@ class MuteEveryonesVideoButton extends AbstractButton<Props, *> {
|
|||
*/
|
||||
function _mapStateToProps(state: Object, ownProps: Props) {
|
||||
const localParticipant = getLocalParticipant(state);
|
||||
const isModerator = localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
|
||||
const { visible } = ownProps;
|
||||
const { disableRemoteMute } = state['features/base/config'];
|
||||
const { visible = isLocalParticipantModerator(state) && !disableRemoteMute } = ownProps;
|
||||
|
||||
return {
|
||||
isModerator,
|
||||
localParticipantId: localParticipant.id,
|
||||
visible: visible && isModerator && !disableRemoteMute
|
||||
visible
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue