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 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // @flow
  2. import { ReducerRegistry } from '../redux';
  3. import {
  4. LIB_DID_DISPOSE,
  5. LIB_DID_INIT,
  6. LIB_INIT_ERROR,
  7. SET_WEBRTC_READY
  8. } from './actionTypes';
  9. /**
  10. * The default/initial redux state of the feature base/lib-jitsi-meet.
  11. *
  12. * @type {Object}
  13. */
  14. const DEFAULT_STATE = {};
  15. ReducerRegistry.register(
  16. 'features/base/lib-jitsi-meet',
  17. (state = DEFAULT_STATE, action) => {
  18. switch (action.type) {
  19. case LIB_DID_DISPOSE:
  20. return DEFAULT_STATE;
  21. case LIB_DID_INIT:
  22. return {
  23. ...state,
  24. initError: undefined,
  25. initialized: true
  26. };
  27. case LIB_INIT_ERROR:
  28. return {
  29. ...state,
  30. initError: action.error,
  31. initialized: false
  32. };
  33. case SET_WEBRTC_READY:
  34. return {
  35. ...state,
  36. webRTCReady: action.webRTCReady
  37. };
  38. default:
  39. return state;
  40. }
  41. });