From ae5c36433332a8d3383ab8196032d87a4a99bb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 9 Dec 2021 11:46:27 -0600 Subject: [PATCH] fix(breakout-rooms) cleanup local tracks when a conference is left. --- react/features/base/tracks/middleware.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/react/features/base/tracks/middleware.js b/react/features/base/tracks/middleware.js index 247fc7b0f..adf0917d9 100644 --- a/react/features/base/tracks/middleware.js +++ b/react/features/base/tracks/middleware.js @@ -210,17 +210,17 @@ MiddlewareRegistry.register(store => next => action => { /** * Set up state change listener to perform maintenance tasks when the conference - * is left or failed, remove all remote tracks from the store. + * is left or failed, remove all tracks from the store. */ StateListenerRegistry.register( state => getCurrentConference(state), (conference, { dispatch, getState }, prevConference) => { if (prevConference && !conference) { - // Clear all remote tracks. - const remoteTracks = getState()['features/base/tracks'].filter(t => !t.local); + // Clear all tracks. + const tracks = getState()['features/base/tracks']; batch(() => { - for (const track of remoteTracks) { + for (const track of tracks) { dispatch(trackRemoved(track.jitsiTrack)); } });