fix: Fixes correct state in lobby screen on wrong password.

Fixes #9869.
This commit is contained in:
Дамян Минков 2021-11-30 10:50:13 -06:00
parent cc931986f6
commit 2adb5dc7d6
1 changed files with 12 additions and 2 deletions

View File

@ -3,7 +3,11 @@
import { batch } from 'react-redux'; import { batch } from 'react-redux';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app'; import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
import { CONFERENCE_FAILED, CONFERENCE_JOINED } from '../base/conference'; import {
CONFERENCE_FAILED,
CONFERENCE_JOINED,
conferenceWillJoin
} from '../base/conference';
import { JitsiConferenceErrors, JitsiConferenceEvents } from '../base/lib-jitsi-meet'; import { JitsiConferenceErrors, JitsiConferenceEvents } from '../base/lib-jitsi-meet';
import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/participants'; import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/participants';
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux'; import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
@ -121,7 +125,8 @@ StateListenerRegistry.register(
function _conferenceFailed({ dispatch, getState }, next, action) { function _conferenceFailed({ dispatch, getState }, next, action) {
const { error } = action; const { error } = action;
const state = getState(); const state = getState();
const nonFirstFailure = Boolean(state['features/base/conference'].membersOnly); const { membersOnly } = state['features/base/conference'];
const nonFirstFailure = Boolean(membersOnly);
if (error.name === JitsiConferenceErrors.MEMBERS_ONLY_ERROR) { if (error.name === JitsiConferenceErrors.MEMBERS_ONLY_ERROR) {
if (typeof error.recoverable === 'undefined') { if (typeof error.recoverable === 'undefined') {
@ -136,6 +141,11 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
dispatch(startKnocking()); dispatch(startKnocking());
} }
// In case of wrong password we need to be in the right state if in the meantime someone allows us to join
if (nonFirstFailure) {
dispatch(conferenceWillJoin(membersOnly));
}
dispatch(setPasswordJoinFailed(nonFirstFailure)); dispatch(setPasswordJoinFailed(nonFirstFailure));
return result; return result;