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

reducer.js 950B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // @flow
  2. import { PersistenceRegistry, 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. * @public
  14. * @type {boolean}
  15. */
  16. tileViewEnabled: false
  17. };
  18. const STORE_NAME = 'features/video-layout';
  19. PersistenceRegistry.register(STORE_NAME, {
  20. tileViewEnabled: true
  21. });
  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. });