fix(config,notifications) fix rendering moderator notifications (#9986)

Move DISABLE_FOCUS_INDICATOR from interface_config.js to config.js (disableModeratorIndicator).
This commit is contained in:
robertpin 2021-09-21 18:38:06 +03:00 committed by GitHub
parent 0a9b9bb41d
commit 5f5cac0e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 6 deletions

View File

@ -74,6 +74,9 @@ var config = {
// callStatsThreshold: 5 // enable callstats for 5% of the users. // callStatsThreshold: 5 // enable callstats for 5% of the users.
}, },
// Disables moderator indicators.
// disableModeratorIndicator: false,
// Enables reactions feature. // Enables reactions feature.
// enableReactions: false, // enableReactions: false,

View File

@ -39,7 +39,8 @@ var interfaceConfig = {
DISABLE_DOMINANT_SPEAKER_INDICATOR: false, DISABLE_DOMINANT_SPEAKER_INDICATOR: false,
DISABLE_FOCUS_INDICATOR: false, // Deprecated. Please use disableModeratorIndicator from config.js
// DISABLE_FOCUS_INDICATOR: false,
/** /**
* If true, notifications regarding joining/leaving are no longer displayed. * If true, notifications regarding joining/leaving are no longer displayed.

View File

@ -570,7 +570,7 @@
"mutedTitle": "You're muted!", "mutedTitle": "You're muted!",
"mutedRemotelyTitle": "You've been muted by {{moderator}}", "mutedRemotelyTitle": "You've been muted by {{moderator}}",
"mutedRemotelyDescription": "You can always unmute when you're ready to speak. Mute back when you're done to keep noise away from the meeting.", "mutedRemotelyDescription": "You can always unmute when you're ready to speak. Mute back when you're done to keep noise away from the meeting.",
"videoMutedRemotelyTitle": "Your camera has been turned off by {{moderator}}", "videoMutedRemotelyTitle": "Your video has been turned off by {{moderator}}",
"videoMutedRemotelyDescription": "You can always turn it on again.", "videoMutedRemotelyDescription": "You can always turn it on again.",
"passwordRemovedRemotely": "$t(lockRoomPasswordUppercase) removed by another participant", "passwordRemovedRemotely": "$t(lockRoomPasswordUppercase) removed by another participant",
"passwordSetRemotely": "$t(lockRoomPasswordUppercase) set by another participant", "passwordSetRemotely": "$t(lockRoomPasswordUppercase) set by another participant",

View File

@ -96,6 +96,7 @@ export default [
'disableIncomingMessageSound', 'disableIncomingMessageSound',
'disableJoinLeaveSounds', 'disableJoinLeaveSounds',
'disableLocalVideoFlip', 'disableLocalVideoFlip',
'disableModeratorIndicator',
'disableNS', 'disableNS',
'disablePolls', 'disablePolls',
'disableProfile', 'disableProfile',

View File

@ -286,6 +286,12 @@ function _translateLegacyConfig(oldValue: Object) {
}; };
} }
if (oldValue.disableModeratorIndicator === undefined
&& typeof interfaceConfig === 'object'
&& interfaceConfig.hasOwnProperty('DISABLE_FOCUS_INDICATOR')) {
newValue.disableModeratorIndicator = interfaceConfig.DISABLE_FOCUS_INDICATOR;
}
return newValue; return newValue;
} }

View File

@ -129,11 +129,13 @@ function _mapStateToProps(state, ownProps) {
isAudioMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.AUDIO, participantID); isAudioMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.AUDIO, participantID);
} }
const { disableModeratorIndicator } = state['features/base/config'];
return { return {
_currentLayout: getCurrentLayout(state), _currentLayout: getCurrentLayout(state),
_showAudioMutedIndicator: isAudioMuted, _showAudioMutedIndicator: isAudioMuted,
_showModeratorIndicator: _showModeratorIndicator:
!interfaceConfig.DISABLE_FOCUS_INDICATOR && participant && participant.role === PARTICIPANT_ROLE.MODERATOR, !disableModeratorIndicator && participant && participant.role === PARTICIPANT_ROLE.MODERATOR,
_showScreenShareIndicator: isScreenSharing, _showScreenShareIndicator: isScreenSharing,
_showVideoMutedIndicator: isVideoMuted _showVideoMutedIndicator: isVideoMuted
}; };

View File

@ -69,13 +69,14 @@ MiddlewareRegistry.register(store => next => action => {
return next(action); return next(action);
} }
case PARTICIPANT_UPDATED: { case PARTICIPANT_UPDATED: {
if (typeof interfaceConfig === 'undefined') { const state = store.getState();
// Do not show the notification for mobile and also when the focus indicator is disabled. const { disableModeratorIndicator } = state['features/base/config'];
if (disableModeratorIndicator) {
return next(action); return next(action);
} }
const { id, role } = action.participant; const { id, role } = action.participant;
const state = store.getState();
const localParticipant = getLocalParticipant(state); const localParticipant = getLocalParticipant(state);
if (localParticipant.id !== id) { if (localParticipant.id !== id) {