snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
47
react/features/jaas/middleware.web.ts
Normal file
47
react/features/jaas/middleware.web.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { redirectToStaticPage } from '../app/actions.web';
|
||||
import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
|
||||
import {
|
||||
JitsiConferenceErrors,
|
||||
JitsiConferenceEvents
|
||||
} from '../base/lib-jitsi-meet';
|
||||
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
||||
|
||||
import { SET_DETAILS } from './actionTypes';
|
||||
import { STATUSES } from './constants';
|
||||
import logger from './logger';
|
||||
|
||||
/**
|
||||
* The redux middleware for jaas.
|
||||
*
|
||||
* @param {Store} store - The redux store.
|
||||
* @returns {Function}
|
||||
*/
|
||||
MiddlewareRegistry.register(store => next => action => {
|
||||
switch (action.type) {
|
||||
case CONFERENCE_JOINED: {
|
||||
const { conference } = action;
|
||||
|
||||
if (store.getState()['features/base/config'].iAmRecorder) {
|
||||
// We don't register anything on web if we are in iAmRecorder mode
|
||||
return next(action);
|
||||
}
|
||||
|
||||
conference.on(
|
||||
JitsiConferenceEvents.CONFERENCE_ERROR, (errorType: string, errorMsg: string) => {
|
||||
errorType === JitsiConferenceErrors.SETTINGS_ERROR && logger.error(errorMsg);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case SET_DETAILS: {
|
||||
const { status } = action.payload;
|
||||
|
||||
if (status === STATUSES.BLOCKED) {
|
||||
store.dispatch(redirectToStaticPage('/static/planLimit.html'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return next(action);
|
||||
});
|
||||
Reference in New Issue
Block a user