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.

reducer.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import {
  4. SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
  5. SELECT_ENDPOINTS,
  6. SET_TILE_VIEW
  7. } from './actionTypes';
  8. const DEFAULT_STATE = {
  9. remoteScreenShares: [],
  10. /**
  11. * The indicator which determines whether the video layout should display
  12. * video thumbnails in a tiled layout.
  13. *
  14. * Note: undefined means that the user hasn't requested anything in particular yet, so
  15. * we use our auto switching rules.
  16. *
  17. * @public
  18. * @type {boolean}
  19. */
  20. tileViewEnabled: undefined
  21. };
  22. const STORE_NAME = 'features/video-layout';
  23. ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
  24. switch (action.type) {
  25. case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED: {
  26. return {
  27. ...state,
  28. remoteScreenShares: action.participantIds
  29. };
  30. }
  31. case SELECT_ENDPOINTS: {
  32. return {
  33. ...state,
  34. selectedEndpoints: action.participantIds
  35. };
  36. }
  37. case SET_TILE_VIEW:
  38. return {
  39. ...state,
  40. tileViewEnabled: action.enabled
  41. };
  42. }
  43. return state;
  44. });