Browse Source

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.
master
paweldomas 8 years ago
parent
commit
dad3c57fad
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      conference.js

+ 4
- 2
conference.js View File

1101
         room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
1101
         room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
1102
             if (this.isLocalId(id)) {
1102
             if (this.isLocalId(id)) {
1103
                 console.info(`My role changed, new role: ${role}`);
1103
                 console.info(`My role changed, new role: ${role}`);
1104
-                this.isModerator = room.isModerator();
1105
-                APP.UI.updateLocalRole(room.isModerator());
1104
+                if (this.isModerator !== room.isModerator()) {
1105
+                    this.isModerator = room.isModerator();
1106
+                    APP.UI.updateLocalRole(room.isModerator());
1107
+                }
1106
             } else {
1108
             } else {
1107
                 let user = room.getParticipantById(id);
1109
                 let user = room.getParticipantById(id);
1108
                 if (user) {
1110
                 if (user) {

Loading…
Cancel
Save