fix(video-layout): Unpin SS when the screensharing participant leaves.
This commit is contained in:
parent
289ba6f764
commit
c12c554138
|
@ -97,19 +97,20 @@ function _getAutoPinSetting() {
|
|||
function _updateAutoPinnedParticipant({ dispatch, getState }) {
|
||||
const state = getState();
|
||||
const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
|
||||
const pinned = getPinnedParticipant(getState);
|
||||
|
||||
// Unpin the screenshare when the screensharing participant has left.
|
||||
if (!remoteScreenShares?.length) {
|
||||
const participantId = pinned ? pinned.id : null;
|
||||
|
||||
dispatch(pinParticipant(participantId));
|
||||
|
||||
if (!remoteScreenShares) {
|
||||
return;
|
||||
}
|
||||
|
||||
const latestScreenshareParticipantId
|
||||
= remoteScreenShares[remoteScreenShares.length - 1];
|
||||
|
||||
const pinned = getPinnedParticipant(getState);
|
||||
const latestScreenshareParticipantId = remoteScreenShares[remoteScreenShares.length - 1];
|
||||
|
||||
if (latestScreenshareParticipantId) {
|
||||
dispatch(pinParticipant(latestScreenshareParticipantId));
|
||||
} else if (pinned) {
|
||||
dispatch(pinParticipant(null));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue