You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.ts 780B

12345678910111213141516171819202122232425262728
  1. import { AnyAction } from 'redux';
  2. import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
  3. import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes';
  4. /**
  5. * Middleware which intercepts participants pane actions.
  6. *
  7. * @param {IStore} store - The redux store.
  8. * @returns {Function}
  9. */
  10. MiddlewareRegistry.register(() => (next: Function) => (action: AnyAction) => {
  11. switch (action.type) {
  12. case PARTICIPANTS_PANE_OPEN:
  13. if (typeof APP !== 'undefined') {
  14. APP.API.notifyParticipantsPaneToggled(true);
  15. }
  16. break;
  17. case PARTICIPANTS_PANE_CLOSE:
  18. if (typeof APP !== 'undefined') {
  19. APP.API.notifyParticipantsPaneToggled(false);
  20. }
  21. break;
  22. }
  23. return next(action);
  24. });