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

12345678910111213141516171819202122232425262728293031323334
  1. // @flow
  2. import { assign, ReducerRegistry } from '../../base/redux';
  3. import { SET_CONFERENCE_TIMESTAMP, SET_SESSION_ID, SET_WATCH_REACHABLE } from './actionTypes';
  4. const INITIAL_STATE = {
  5. sessionID: new Date().getTime()
  6. };
  7. /**
  8. * Reduces the Redux actions of the feature features/mobile/watchos.
  9. */
  10. ReducerRegistry.register('features/mobile/watchos', (state = INITIAL_STATE, action) => {
  11. switch (action.type) {
  12. case SET_CONFERENCE_TIMESTAMP: {
  13. return assign(state, {
  14. conferenceTimestamp: action.conferenceTimestamp
  15. });
  16. }
  17. case SET_SESSION_ID: {
  18. return assign(state, {
  19. sessionID: action.sessionID,
  20. conferenceTimestamp: 0
  21. });
  22. }
  23. case SET_WATCH_REACHABLE: {
  24. return assign(state, {
  25. watchReachable: action.watchReachable
  26. });
  27. }
  28. default:
  29. return state;
  30. }
  31. });