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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. const DEFAULT_STATE = {
  12. /**
  13. * The indicator which determines whether the video layout should display
  14. * video thumbnails in a tiled layout.
  15. *
  16. * @public
  17. * @type {boolean}
  18. */
  19. tileViewEnabled: false
  20. };
  21. const STORE_NAME = 'features/video-layout';
  22. PersistenceRegistry.register(STORE_NAME, {
  23. tileViewEnabled: true
  24. });
  25. ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
  26. switch (action.type) {
  27. case SCREEN_SHARE_PARTICIPANTS_UPDATED: {
  28. return {
  29. ...state,
  30. screenShares: action.participantIds
  31. };
  32. }
  33. case SET_TILE_VIEW:
  34. return {
  35. ...state,
  36. tileViewEnabled: action.enabled
  37. };
  38. }
  39. return state;
  40. });