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

1234567891011121314151617181920212223242526
  1. /* @flow */
  2. import { assign, ReducerRegistry } from '../../base/redux';
  3. import {
  4. INCOMING_CALL_ANSWERED,
  5. INCOMING_CALL_DECLINED,
  6. INCOMING_CALL_RECEIVED
  7. } from './actionTypes';
  8. ReducerRegistry.register(
  9. 'features/mobile/incoming-call', (state = {}, action) => {
  10. switch (action.type) {
  11. case INCOMING_CALL_ANSWERED:
  12. case INCOMING_CALL_DECLINED:
  13. return assign(state, {
  14. caller: undefined
  15. });
  16. case INCOMING_CALL_RECEIVED:
  17. return assign(state, {
  18. caller: action.caller
  19. });
  20. }
  21. return state;
  22. });