From 5a5656020baf5634477dd1c4d854021d84c11517 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Tue, 7 Mar 2023 11:12:33 -0600 Subject: [PATCH] fix(e2ee): enabled/supported flags calculation. --- react/features/base/participants/reducer.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/react/features/base/participants/reducer.ts b/react/features/base/participants/reducer.ts index f1f30741e..a122d1449 100644 --- a/react/features/base/participants/reducer.ts +++ b/react/features/base/participants/reducer.ts @@ -220,11 +220,14 @@ ReducerRegistry.register('features/base/participants', state.numberOfNonModeratorParticipants += isModerator ? -1 : 1; } - if (oldParticipant.e2eeEnabled !== newParticipant.e2eeEnabled) { - state.numberOfParticipantsDisabledE2EE += newParticipant.e2eeEnabled ? -1 : 1; + const e2eeEnabled = Boolean(newParticipant.e2eeEnabled); + const e2eeSupported = Boolean(newParticipant.e2eeSupported); + + if (Boolean(oldParticipant.e2eeEnabled) !== e2eeEnabled) { + state.numberOfParticipantsDisabledE2EE += e2eeEnabled ? -1 : 1; } - if (!local && oldParticipant.e2eeSupported !== newParticipant.e2eeSupported) { - state.numberOfParticipantsNotSupportingE2EE += newParticipant.e2eeSupported ? -1 : 1; + if (!local && Boolean(oldParticipant.e2eeSupported) !== e2eeSupported) { + state.numberOfParticipantsNotSupportingE2EE += e2eeSupported ? -1 : 1; } }