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 {
|
|
|
|
enabled: boolean
|
|
|
|
}
|
2019-07-31 12:47:52 +00:00
|
|
|
|
|
|
|
const DEFAULT_STATE = {
|
|
|
|
enabled: false
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-07-01 09:32:39 +00:00
|
|
|
ReducerRegistry.register('features/base/audio-only', (state: IAudioOnlyState = DEFAULT_STATE, action) => {
|
2019-07-31 12:47:52 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case SET_AUDIO_ONLY:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
enabled: action.audioOnly
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
});
|