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.js 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { CONFERENCE_JOINED } from '../base/conference';
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import { setInfoDialogVisibility } from './actions';
  4. import { UPDATE_DIAL_IN_NUMBERS_FAILED } from './actionTypes';
  5. const logger = require('jitsi-meet-logger').getLogger(__filename);
  6. /**
  7. * Middleware that catches actions fetching dial-in numbers.
  8. *
  9. * @param {Store} store - Redux store.
  10. * @returns {Function}
  11. */
  12. // eslint-disable-next-line no-unused-vars
  13. MiddlewareRegistry.register(store => next => action => {
  14. const result = next(action);
  15. switch (action.type) {
  16. case CONFERENCE_JOINED:
  17. // we do not want to show call info in iAmRecorder mode
  18. if (store.getState()['features/base/config'].iAmRecorder) {
  19. return result;
  20. }
  21. store.dispatch(setInfoDialogVisibility(true, true));
  22. break;
  23. case UPDATE_DIAL_IN_NUMBERS_FAILED:
  24. logger.error(
  25. 'Error encountered while fetching dial-in numbers:',
  26. action.error);
  27. break;
  28. }
  29. return result;
  30. });