Browse Source

fix(e2ee): enabled/supported flags calculation.

factor2
Hristo Terezov 2 years ago
parent
commit
5a5656020b
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      react/features/base/participants/reducer.ts

+ 7
- 4
react/features/base/participants/reducer.ts View File

220
                 state.numberOfNonModeratorParticipants += isModerator ? -1 : 1;
220
                 state.numberOfNonModeratorParticipants += isModerator ? -1 : 1;
221
             }
221
             }
222
 
222
 
223
-            if (oldParticipant.e2eeEnabled !== newParticipant.e2eeEnabled) {
224
-                state.numberOfParticipantsDisabledE2EE += newParticipant.e2eeEnabled ? -1 : 1;
223
+            const e2eeEnabled = Boolean(newParticipant.e2eeEnabled);
224
+            const e2eeSupported = Boolean(newParticipant.e2eeSupported);
225
+
226
+            if (Boolean(oldParticipant.e2eeEnabled) !== e2eeEnabled) {
227
+                state.numberOfParticipantsDisabledE2EE += e2eeEnabled ? -1 : 1;
225
             }
228
             }
226
-            if (!local && oldParticipant.e2eeSupported !== newParticipant.e2eeSupported) {
227
-                state.numberOfParticipantsNotSupportingE2EE += newParticipant.e2eeSupported ? -1 : 1;
229
+            if (!local && Boolean(oldParticipant.e2eeSupported) !== e2eeSupported) {
230
+                state.numberOfParticipantsNotSupportingE2EE += e2eeSupported ? -1 : 1;
228
             }
231
             }
229
         }
232
         }
230
 
233
 

Loading…
Cancel
Save