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

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // @flow
  2. import { assign, ReducerRegistry } from '../base/redux';
  3. import {
  4. _SET_EMITTER_SUBSCRIPTIONS,
  5. UPDATE_DIAL_IN_NUMBERS_FAILED,
  6. UPDATE_DIAL_IN_NUMBERS_SUCCESS
  7. } from './actionTypes';
  8. const DEFAULT_STATE = {
  9. numbersEnabled: true
  10. };
  11. ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
  12. switch (action.type) {
  13. case _SET_EMITTER_SUBSCRIPTIONS:
  14. return (
  15. assign(state, 'emitterSubscriptions', action.emitterSubscriptions));
  16. case UPDATE_DIAL_IN_NUMBERS_FAILED:
  17. return {
  18. ...state,
  19. error: action.error
  20. };
  21. case UPDATE_DIAL_IN_NUMBERS_SUCCESS: {
  22. const {
  23. defaultCountry,
  24. numbers,
  25. numbersEnabled
  26. } = action.dialInNumbers;
  27. return {
  28. ...state,
  29. conferenceID: action.conferenceID,
  30. defaultCountry,
  31. numbers,
  32. numbersEnabled
  33. };
  34. }
  35. }
  36. return state;
  37. });