theluyuan 38ba663466
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
init
2025-09-02 14:49:16 +08:00

29 lines
780 B
TypeScript

import { AnyAction } from 'redux';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes';
/**
* Middleware which intercepts participants pane actions.
*
* @param {IStore} store - The redux store.
* @returns {Function}
*/
MiddlewareRegistry.register(() => (next: Function) => (action: AnyAction) => {
switch (action.type) {
case PARTICIPANTS_PANE_OPEN:
if (typeof APP !== 'undefined') {
APP.API.notifyParticipantsPaneToggled(true);
}
break;
case PARTICIPANTS_PANE_CLOSE:
if (typeof APP !== 'undefined') {
APP.API.notifyParticipantsPaneToggled(false);
}
break;
}
return next(action);
});