2018-07-16 16:36:32 +00:00
|
|
|
// @flow
|
2018-07-15 14:50:38 +00:00
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
import { ReducerRegistry, set } from '../../base/redux';
|
2018-07-15 14:50:38 +00:00
|
|
|
|
|
|
|
import {
|
|
|
|
INCOMING_CALL_ANSWERED,
|
|
|
|
INCOMING_CALL_DECLINED,
|
|
|
|
INCOMING_CALL_RECEIVED
|
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
ReducerRegistry.register(
|
|
|
|
'features/mobile/incoming-call', (state = {}, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case INCOMING_CALL_ANSWERED:
|
|
|
|
case INCOMING_CALL_DECLINED:
|
2018-07-16 16:36:32 +00:00
|
|
|
return set(state, 'caller', undefined);
|
|
|
|
|
2018-07-15 14:50:38 +00:00
|
|
|
case INCOMING_CALL_RECEIVED:
|
2018-07-16 16:36:32 +00:00
|
|
|
return set(state, 'caller', action.caller);
|
2018-07-15 14:50:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|