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

123456789101112131415161718192021222324
  1. import { UPDATE_DEVICE_LIST } from '../base/devices';
  2. import { MiddlewareRegistry } from '../base/redux';
  3. /**
  4. * Implements the middleware of the feature device-selection.
  5. *
  6. * @param {Store} store - Redux store.
  7. * @returns {Function}
  8. */
  9. // eslint-disable-next-line no-unused-vars
  10. MiddlewareRegistry.register(store => next => action => {
  11. const result = next(action);
  12. if (action.type === UPDATE_DEVICE_LIST) {
  13. const { popupDialogData }
  14. = store.getState()['features/device-selection'];
  15. if (popupDialogData) {
  16. popupDialogData.transport.sendEvent({ name: 'deviceListChanged' });
  17. }
  18. }
  19. return result;
  20. });