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

123456789101112131415161718192021222324252627282930313233343536
  1. // @flow
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import { updateSettings } from '../base/settings';
  4. import { PREJOIN_START_CONFERENCE } from './actionTypes';
  5. declare var APP: Object;
  6. /**
  7. * The redux middleware for {@link PrejoinPage}.
  8. *
  9. * @param {Store} store - The redux store.
  10. * @returns {Function}
  11. */
  12. MiddlewareRegistry.register(store => next => async action => {
  13. switch (action.type) {
  14. case PREJOIN_START_CONFERENCE: {
  15. const { getState, dispatch } = store;
  16. const state = getState();
  17. const { userSelectedSkipPrejoin } = state['features/prejoin'];
  18. const tracks = state['features/base/tracks'];
  19. userSelectedSkipPrejoin && dispatch(updateSettings({
  20. userSelectedSkipPrejoin
  21. }));
  22. APP.conference.prejoinStart(tracks.map(t => t.jitsiTrack));
  23. break;
  24. }
  25. }
  26. return next(action);
  27. });