2022-07-11 12:30:37 +00:00
|
|
|
/* eslint-disable import/order */
|
|
|
|
|
2022-06-21 13:23:33 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { MiddlewareRegistry } from '../base/redux';
|
2022-07-11 12:30:37 +00:00
|
|
|
|
2022-06-21 13:23:33 +00:00
|
|
|
import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes';
|
|
|
|
|
|
|
|
|
2022-07-11 12:30:37 +00:00
|
|
|
declare let APP: any;
|
2022-06-21 13:23:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Middleware which intercepts participants pane actions.
|
|
|
|
*
|
|
|
|
* @param {IStore} store - The redux store.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2022-07-11 12:30:37 +00:00
|
|
|
MiddlewareRegistry.register(() => (next:Function) => (action:any) => {
|
|
|
|
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;
|
2022-06-21 13:23:33 +00:00
|
|
|
}
|
2022-07-11 12:30:37 +00:00
|
|
|
|
2022-06-21 13:23:33 +00:00
|
|
|
return next(action);
|
|
|
|
});
|