diff --git a/react/features/room-lock/middleware.js b/react/features/room-lock/middleware.js index da022e2ed..47ab2d53f 100644 --- a/react/features/room-lock/middleware.js +++ b/react/features/room-lock/middleware.js @@ -2,6 +2,7 @@ import { CONFERENCE_FAILED, + CONFERENCE_JOINED, LOCK_STATE_CHANGED, SET_PASSWORD_FAILED } from '../base/conference'; @@ -33,6 +34,9 @@ MiddlewareRegistry.register(store => next => action => { case CONFERENCE_FAILED: return _conferenceFailed(store, next, action); + case CONFERENCE_JOINED: + return _conferenceJoined(store, next, action); + case LOCK_STATE_CHANGED: { // TODO Remove this logic when all components interested in the lock // state change event are moved into react/redux. @@ -67,6 +71,25 @@ MiddlewareRegistry.register(store => next => action => { return next(action); }); +/** + * Handles cleanup of lock prompt state when a conference is joined. + * + * @param {Store} store - The redux store in which the specified action is being + * dispatched. + * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the + * specified action to the specified store. + * @param {Action} action - The redux action {@code CONFERENCE_JOINED} which + * specifies the details associated with joining the conference. + * @private + * @returns {*} + */ +function _conferenceJoined({ dispatch }, next, action) { + dispatch(hideDialog(PasswordRequiredPrompt)); + dispatch(hideDialog(RoomLockPrompt)); + + return next(action); +} + /** * Handles errors that occur when a conference fails. *