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

reducer.js 997B

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