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 {
|
2022-10-13 08:26:28 +00:00
|
|
|
noisyAudioInputNotificationUid?: string;
|
2022-08-26 09:54:16 +00:00
|
|
|
}
|
|
|
|
|
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-09-05 09:05:07 +00:00
|
|
|
ReducerRegistry.register<INoiseDetectionState>('features/noise-detection',
|
|
|
|
(state = {}, action): INoiseDetectionState => {
|
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;
|
|
|
|
});
|