Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

reducer.js 1004B

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