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.web.js 860B

123456789101112131415161718192021222324252627282930313233
  1. import { redirectToStaticPage } from '../app/actions';
  2. import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
  3. import { MiddlewareRegistry } from '../base/redux';
  4. import { SET_DETAILS } from './actionTypes';
  5. import { getCustomerDetails } from './actions';
  6. import { STATUSES } from './constants';
  7. /**
  8. * The redux middleware for billing counter.
  9. *
  10. * @param {Store} store - The redux store.
  11. * @returns {Function}
  12. */
  13. MiddlewareRegistry.register(store => next => async action => {
  14. switch (action.type) {
  15. case CONFERENCE_JOINED: {
  16. store.dispatch(getCustomerDetails());
  17. break;
  18. }
  19. case SET_DETAILS: {
  20. const { status } = action.payload;
  21. if (status === STATUSES.BLOCKED) {
  22. store.dispatch(redirectToStaticPage('/static/planLimit.html'));
  23. }
  24. }
  25. }
  26. return next(action);
  27. });