Skip to content

Commit

Permalink
fix: Skips clearing tracks on conference failed.
Browse files Browse the repository at this point in the history
In case of conference failed as max number of occupants reached, we should skip clearing the local tracks to keep state of pre-join screen. Otherwise, on join we will join muted even though on prejoin screen it was unmuted on the initial attempt.
  • Loading branch information
damencho committed Apr 15, 2022
1 parent 4a375aa commit bbfe7b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion react/features/base/tracks/middleware.js
Expand Up @@ -318,9 +318,10 @@ MiddlewareRegistry.register(store => next => action => {
StateListenerRegistry.register(
state => getCurrentConference(state),
(conference, { dispatch, getState }, prevConference) => {
const { authRequired, error } = getState()['features/base/conference'];

// conference keep flipping while we are authenticating, skip clearing while we are in that process
if (prevConference && !conference && !getState()['features/base/conference'].authRequired) {
if (prevConference && !conference && !authRequired && !error) {

// Clear all tracks.
const remoteTracks = getState()['features/base/tracks'].filter(t => !t.local);
Expand Down

0 comments on commit bbfe7b4

Please sign in to comment.