2022-07-27 09:56:07 +00:00
|
|
|
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
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';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Middleware which intercepts participants pane actions.
|
|
|
|
*
|
|
|
|
* @param {IStore} store - The redux store.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
MiddlewareRegistry.register(() => (next: Function) => (action: any) => {
|
2022-07-11 12:30:37 +00:00
|
|
|
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);
|
|
|
|
});
|