fix(lock): ensure lock prompt is closed on password submit

This addresses a bug, in which submitting a password
through the iframe api no longer closes RoomLockPrompt,
by explicitly closing prompts for a lock or password.
This commit is contained in:
Leonard Kim 2019-12-06 15:28:14 -08:00 committed by virtuacoplenny
parent e683d70a18
commit 68cad276bd
1 changed files with 23 additions and 0 deletions

View File

@ -2,6 +2,7 @@
import { import {
CONFERENCE_FAILED, CONFERENCE_FAILED,
CONFERENCE_JOINED,
LOCK_STATE_CHANGED, LOCK_STATE_CHANGED,
SET_PASSWORD_FAILED SET_PASSWORD_FAILED
} from '../base/conference'; } from '../base/conference';
@ -33,6 +34,9 @@ MiddlewareRegistry.register(store => next => action => {
case CONFERENCE_FAILED: case CONFERENCE_FAILED:
return _conferenceFailed(store, next, action); return _conferenceFailed(store, next, action);
case CONFERENCE_JOINED:
return _conferenceJoined(store, next, action);
case LOCK_STATE_CHANGED: { case LOCK_STATE_CHANGED: {
// TODO Remove this logic when all components interested in the lock // TODO Remove this logic when all components interested in the lock
// state change event are moved into react/redux. // state change event are moved into react/redux.
@ -67,6 +71,25 @@ MiddlewareRegistry.register(store => next => action => {
return 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. * Handles errors that occur when a conference fails.
* *