Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

middleware.js 719B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import { UPDATE_DEVICE_LIST } from '../base/devices';
  3. import { MiddlewareRegistry } from '../base/redux';
  4. declare var APP: Object;
  5. /**
  6. * Implements the middleware of the feature device-selection.
  7. *
  8. * @param {Store} store - Redux store.
  9. * @returns {Function}
  10. */
  11. // eslint-disable-next-line no-unused-vars
  12. MiddlewareRegistry.register(store => next => action => {
  13. const result = next(action);
  14. if (action.type === UPDATE_DEVICE_LIST) {
  15. const state = store.getState();
  16. const { availableDevices } = state['features/base/devices'] || {};
  17. if (typeof APP !== 'undefined') {
  18. APP.API.notifyDeviceListChanged(availableDevices);
  19. }
  20. }
  21. return result;
  22. });