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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import { PersistenceRegistry } from '../base/storage';
  4. import {
  5. SCREEN_SHARE_PARTICIPANTS_UPDATED,
  6. SET_TILE_VIEW
  7. } from './actionTypes';
  8. const DEFAULT_STATE = {
  9. screenShares: [],
  10. /**
  11. * The indicator which determines whether the video layout should display
  12. * video thumbnails in a tiled layout.
  13. *
  14. * @public
  15. * @type {boolean}
  16. */
  17. tileViewEnabled: false
  18. };
  19. const STORE_NAME = 'features/video-layout';
  20. PersistenceRegistry.register(STORE_NAME, {
  21. tileViewEnabled: true
  22. });
  23. ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
  24. switch (action.type) {
  25. case SCREEN_SHARE_PARTICIPANTS_UPDATED: {
  26. return {
  27. ...state,
  28. screenShares: action.participantIds
  29. };
  30. }
  31. case SET_TILE_VIEW:
  32. return {
  33. ...state,
  34. tileViewEnabled: action.enabled
  35. };
  36. }
  37. return state;
  38. });