From 3548485e842c3e5c1998a0e73369472a696e4a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 1 Dec 2021 13:47:54 +0100 Subject: [PATCH] fix(participants) fix unpinning when switching conferences --- react/features/base/participants/reducer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/react/features/base/participants/reducer.js b/react/features/base/participants/reducer.js index 8a3c6f3eb..5e5ff9f3f 100644 --- a/react/features/base/participants/reducer.js +++ b/react/features/base/participants/reducer.js @@ -146,7 +146,7 @@ ReducerRegistry.register('features/base/participants', (state = DEFAULT_STATE, a _updateParticipantProperty(state, pinnedParticipant, 'pinned', false); } - if (_updateParticipantProperty(state, id, 'pinned', true)) { + if (id && _updateParticipantProperty(state, id, 'pinned', true)) { return { ...state, pinnedParticipant: id @@ -503,7 +503,9 @@ function _updateParticipantProperty(state, id, property, value) { remote.set(id, set(remote.get(id), property, value)); return true; - } else if (local?.id === id) { + } else if (local?.id === id || local?.id === 'local') { + // The local participant's ID can chance from something to "local" when + // not in a conference. state.local = set(local, property, value); return true;