fix: Skips clearing tracks on conference failed.

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.
This commit is contained in:
Дамян Минков 2022-04-14 14:35:41 -05:00
parent 4a375aa2a4
commit bbfe7b4f32
1 changed files with 2 additions and 1 deletions

View File

@ -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);