2022-07-01 09:32:39 +00:00
|
|
|
import ReducerRegistry from '../redux/ReducerRegistry';
|
2019-07-31 12:47:52 +00:00
|
|
|
|
|
|
|
import { SET_AUDIO_ONLY } from './actionTypes';
|
|
|
|
|
2022-07-01 09:32:39 +00:00
|
|
|
export interface IAudioOnlyState {
|
2022-09-08 09:52:36 +00:00
|
|
|
enabled: boolean;
|
2022-07-01 09:32:39 +00:00
|
|
|
}
|
2019-07-31 12:47:52 +00:00
|
|
|
|
|
|
|
const DEFAULT_STATE = {
|
|
|
|
enabled: false
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-09-05 09:05:07 +00:00
|
|
|
ReducerRegistry.register<IAudioOnlyState>('features/base/audio-only',
|
|
|
|
(state = DEFAULT_STATE, action): IAudioOnlyState => {
|
2019-07-31 12:47:52 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case SET_AUDIO_ONLY:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
enabled: action.audioOnly
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
});
|