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

123456789101112131415161718192021222324252627282930313233
  1. import {
  2. CONFERENCE_FAILED,
  3. CONFERENCE_JOINED,
  4. CONFERENCE_LEFT
  5. } from '../base/conference';
  6. import { ReducerRegistry, setStateProperty } from '../base/redux';
  7. import { BEGIN_ROOM_LOCK_REQUEST, END_ROOM_LOCK_REQUEST } from './actionTypes';
  8. ReducerRegistry.register('features/room-lock', (state = {}, action) => {
  9. switch (action.type) {
  10. case BEGIN_ROOM_LOCK_REQUEST:
  11. return setStateProperty(state, 'requested', action.conference);
  12. case CONFERENCE_FAILED:
  13. case CONFERENCE_LEFT:
  14. case END_ROOM_LOCK_REQUEST: {
  15. if (state.requested === action.conference) {
  16. return setStateProperty(state, 'requested', undefined);
  17. }
  18. break;
  19. }
  20. case CONFERENCE_JOINED: {
  21. if (state.requested !== action.conference) {
  22. return setStateProperty(state, 'requested', undefined);
  23. }
  24. break;
  25. }
  26. }
  27. return state;
  28. });