From efb2f6f9f305393a3a906cd16ddbb2f358b84deb Mon Sep 17 00:00:00 2001 From: Ovgodd Date: Wed, 7 Oct 2026 13:34:32 +0200 Subject: [PATCH] =?UTF-8?q?fixup!=20=E2=9C=A8(frontend)=20free=20the=20mee?= =?UTF-8?q?ting=20layout=20while=20a=20screen=20share=20is=20popped=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/components/StageLayout.tsx | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/features/layout/components/StageLayout.tsx b/src/frontend/src/features/layout/components/StageLayout.tsx index 3acb9ac86..b1fac8355 100644 --- a/src/frontend/src/features/layout/components/StageLayout.tsx +++ b/src/frontend/src/features/layout/components/StageLayout.tsx @@ -40,19 +40,15 @@ export const StageLayout = () => { // The popped-out share stays mounted below, but out of the grid and the // carousel. It comes back with the other tracks when its window closes. - const visibleTracks = detachedSid - ? tracks.filter( - (track) => - !isTrackReference(track) || track.publication.trackSid !== detachedSid - ) - : tracks - - const detachedTrack = detachedSid - ? tracks.find( - (track) => - isTrackReference(track) && track.publication.trackSid === detachedSid - ) - : undefined + const visibleTracks: TrackReferenceOrPlaceholder[] = [] + let detachedTrack: TrackReferenceOrPlaceholder | undefined + for (const track of tracks) { + if (isTrackReference(track) && track.publication.trackSid === detachedSid) { + detachedTrack = track + } else { + visibleTracks.push(track) + } + } const carouselTracks = visibleTracks.filter( (track) => !isEqualTrackRef(track, pinnedTrackRef)