您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

reducer.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import {
  4. FAKE_SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
  5. SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
  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 FAKE_SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
  26. case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED: {
  27. return {
  28. ...state,
  29. remoteScreenShares: action.participantIds
  30. };
  31. }
  32. case SET_TILE_VIEW:
  33. return {
  34. ...state,
  35. tileViewEnabled: action.enabled
  36. };
  37. }
  38. return state;
  39. });