fix(conference): react to local role change only when it changes

We initialise the UI for isModerator = false on startup, so we should
not react to the event unless it gets out of sync.
This commit is contained in:
paweldomas 2016-09-28 13:41:02 -05:00
parent f10177a352
commit dad3c57fad
1 changed files with 4 additions and 2 deletions

View File

@ -1101,8 +1101,10 @@ export default {
room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
if (this.isLocalId(id)) {
console.info(`My role changed, new role: ${role}`);
this.isModerator = room.isModerator();
APP.UI.updateLocalRole(room.isModerator());
if (this.isModerator !== room.isModerator()) {
this.isModerator = room.isModerator();
APP.UI.updateLocalRole(room.isModerator());
}
} else {
let user = room.getParticipantById(id);
if (user) {