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

123456789101112131415161718192021222324252627282930
  1. // @flow
  2. import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
  3. import { MiddlewareRegistry } from '../base/redux';
  4. declare var APP: Object;
  5. /**
  6. * The middleware of the feature {@code external-api}.
  7. *
  8. * @returns {Function}
  9. */
  10. MiddlewareRegistry.register((/* store */) => next => action => {
  11. switch (action.type) {
  12. case NOTIFY_CAMERA_ERROR:
  13. if (action.error) {
  14. APP.API.notifyOnCameraError(
  15. action.error.name, action.error.message);
  16. }
  17. break;
  18. case NOTIFY_MIC_ERROR:
  19. if (action.error) {
  20. APP.API.notifyOnMicError(action.error.name, action.error.message);
  21. }
  22. break;
  23. }
  24. return next(action);
  25. });