2022-08-26 09:54:16 +00:00
|
|
|
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
|
|
|
import { set } from '../base/redux/functions';
|
2020-01-20 18:00:12 +00:00
|
|
|
|
|
|
|
import { SET_NOISY_AUDIO_INPUT_NOTIFICATION_UID } from './actionTypes';
|
|
|
|
|
2022-08-26 09:54:16 +00:00
|
|
|
export interface INoiseDetectionState {
|
|
|
|
noisyAudioInputNotificationUid?: number;
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:00:12 +00:00
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* Reduces the redux actions of noise detection feature.
|
2020-01-20 18:00:12 +00:00
|
|
|
*/
|
2022-08-26 09:54:16 +00:00
|
|
|
ReducerRegistry.register('features/noise-detection', (state: INoiseDetectionState = {}, action) => {
|
2020-01-20 18:00:12 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case SET_NOISY_AUDIO_INPUT_NOTIFICATION_UID:
|
|
|
|
return set(state, 'noisyAudioInputNotificationUid', action.uid);
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|