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 794B

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