code review

This commit is contained in:
Tudor-Ovidiu Avram 2021-07-15 12:09:03 +03:00 committed by Horatiu Muresan
parent 5a3607f63f
commit 0ab905bf75
1 changed files with 10 additions and 6 deletions

View File

@ -3,16 +3,12 @@ import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
import { CONNECTION_FAILED } from '../base/connection'; import { CONNECTION_FAILED } from '../base/connection';
import { JitsiConnectionErrors } from '../base/lib-jitsi-meet'; import { JitsiConnectionErrors } from '../base/lib-jitsi-meet';
import { MiddlewareRegistry } from '../base/redux'; import { MiddlewareRegistry } from '../base/redux';
import { isVpaasMeeting } from '../billing-counter/functions';
import { SET_DETAILS } from './actionTypes'; import { SET_DETAILS } from './actionTypes';
import { getCustomerDetails } from './actions'; import { getCustomerDetails } from './actions';
import { STATUSES } from './constants'; import { STATUSES } from './constants';
const redirectErrors = [
JitsiConnectionErrors.CONNECTION_DROPPED_ERROR,
JitsiConnectionErrors.PASSWORD_REQUIRED
];
/** /**
* The redux middleware for jaas. * The redux middleware for jaas.
* *
@ -29,7 +25,15 @@ MiddlewareRegistry.register(store => next => async action => {
case CONNECTION_FAILED: { case CONNECTION_FAILED: {
const { error } = action; const { error } = action;
if (error && redirectErrors.includes(error.name)) { if (!isVpaasMeeting(store.getState()) || !error) {
break;
}
if (error.name === JitsiConnectionErrors.PASSWORD_REQUIRED) {
if (error.message !== 'could not obtain public key') {
break;
}
store.dispatch(redirectToStaticPage('/static/planLimit.html')); store.dispatch(redirectToStaticPage('/static/planLimit.html'));
} }
break; break;