fix*(jaas) redirect to plan limit page on connection failed
This commit is contained in:
parent
d57e202d19
commit
5a3607f63f
|
@ -1,18 +1,24 @@
|
|||
import { redirectToStaticPage } from '../app/actions';
|
||||
import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
|
||||
import { CONNECTION_FAILED } from '../base/connection';
|
||||
import { JitsiConnectionErrors } from '../base/lib-jitsi-meet';
|
||||
import { MiddlewareRegistry } from '../base/redux';
|
||||
|
||||
import { SET_DETAILS } from './actionTypes';
|
||||
import { getCustomerDetails } from './actions';
|
||||
import { STATUSES } from './constants';
|
||||
|
||||
const redirectErrors = [
|
||||
JitsiConnectionErrors.CONNECTION_DROPPED_ERROR,
|
||||
JitsiConnectionErrors.PASSWORD_REQUIRED
|
||||
];
|
||||
|
||||
/**
|
||||
* The redux middleware for billing counter.
|
||||
* The redux middleware for jaas.
|
||||
*
|
||||
* @param {Store} store - The redux store.
|
||||
* @returns {Function}
|
||||
*/
|
||||
|
||||
MiddlewareRegistry.register(store => next => async action => {
|
||||
switch (action.type) {
|
||||
case CONFERENCE_JOINED: {
|
||||
|
@ -20,6 +26,14 @@ MiddlewareRegistry.register(store => next => async action => {
|
|||
break;
|
||||
}
|
||||
|
||||
case CONNECTION_FAILED: {
|
||||
const { error } = action;
|
||||
|
||||
if (error && redirectErrors.includes(error.name)) {
|
||||
store.dispatch(redirectToStaticPage('/static/planLimit.html'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SET_DETAILS: {
|
||||
const { status } = action.payload;
|
||||
|
||||
|
|
Loading…
Reference in New Issue