From eed57e7999bda0812b396f98e2e1d880906ca552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 18 Jun 2020 09:55:48 +0200 Subject: [PATCH] subject: only try to update the subject when the rol;e changes Skip processing any other participant updates. --- react/features/base/conference/middleware.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.js index 133d6995b..130729bea 100644 --- a/react/features/base/conference/middleware.js +++ b/react/features/base/conference/middleware.js @@ -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)); + } } }