Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

middleware.ts 738B

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