subject: only try to update the subject when the rol;e changes

Skip processing any other participant updates.
This commit is contained in:
Saúl Ibarra Corretgé 2020-06-18 09:55:48 +02:00 committed by Saúl Ibarra Corretgé
parent 8115f86f59
commit eed57e7999
1 changed files with 7 additions and 6 deletions

View File

@ -615,13 +615,14 @@ function _updateLocalParticipantInConference({ dispatch, getState }, next, actio
conference.setDisplayName(participant.name);
}
const { pendingSubjectChange, subject } = getState()['features/base/conference'];
const isModerator = participant.role === PARTICIPANT_ROLE.MODERATOR;
if ('role' in participant && participant.role === PARTICIPANT_ROLE.MODERATOR) {
const { pendingSubjectChange, subject } = getState()['features/base/conference'];
// when local user role is updated to moderator and we have a pending subject change
// which was not reflected we need to set it (the first time we tried was before becoming moderator)
if (isModerator && pendingSubjectChange !== subject) {
dispatch(setSubject(pendingSubjectChange));
// When the local user role is updated to moderator and we have a pending subject change
// which was not reflected we need to set it (the first time we tried was before becoming moderator).
if (pendingSubjectChange !== subject) {
dispatch(setSubject(pendingSubjectChange));
}
}
}