Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(toolbox) fix displaying mute everyone buttons for non-moderators

Saúl Ibarra Corretgé47c9e1415515
diff --git a/react/features/toolbox/components/MuteEveryoneButton.js b/react/features/toolbox/components/MuteEveryoneButton.js
index 87f4ffbcaf..e759a391dd 100644
--- a/react/features/toolbox/components/MuteEveryoneButton.js
+++ b/react/features/toolbox/components/MuteEveryoneButton.js
@@ -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
};
}
diff --git a/react/features/toolbox/components/MuteEveryonesVideoButton.js b/react/features/toolbox/components/MuteEveryonesVideoButton.js
index b682f534c2..04d3cb2cd7 100644
--- a/react/features/toolbox/components/MuteEveryonesVideoButton.js
+++ b/react/features/toolbox/components/MuteEveryonesVideoButton.js
@@ -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
};
}