fix(stage-tile-view): crash when pinning

This commit is contained in:
Hristo Terezov 2022-05-06 16:32:09 -05:00
parent 01bd18b86a
commit 084f911699
1 changed files with 12 additions and 5 deletions

View File

@ -171,13 +171,20 @@ MiddlewareRegistry.register(store => next => action => {
}
}
dispatch(setStageParticipants(queue));
if (!pinned) {
const timeoutId = setTimeout(() => dispatch(removeStageParticipant(participantId)),
ACTIVE_PARTICIPANT_TIMEOUT);
// If queue is undefined we haven't made any changes to the active participants. This will mostly happen
// if the participant that we are trying to add is not pinned and all slots are currently taken by pinned
// participants.
// IMPORTANT: setting active participants to undefined will crash jitsi-meet.
if (typeof queue !== 'undefined') {
dispatch(setStageParticipants(queue));
if (!pinned) {
const timeoutId = setTimeout(() => dispatch(removeStageParticipant(participantId)),
ACTIVE_PARTICIPANT_TIMEOUT);
timers.set(participantId, timeoutId);
timers.set(participantId, timeoutId);
}
}
if (getCurrentLayout(state) === LAYOUTS.TILE_VIEW) {
dispatch(setTileView(false));
}