jiti-meet/react/features/settings/reducer.ts

29 lines
692 B
TypeScript
Raw Permalink Normal View History

2022-09-01 11:00:49 +00:00
import ReducerRegistry from '../base/redux/ReducerRegistry';
import {
SET_AUDIO_SETTINGS_VISIBILITY,
SET_VIDEO_SETTINGS_VISIBILITY
} from './actionTypes';
2022-09-01 11:00:49 +00:00
export interface ISettingsState {
audioSettingsVisible?: boolean;
videoSettingsVisible?: boolean;
}
ReducerRegistry.register('features/settings', (state: ISettingsState = {}, action) => {
switch (action.type) {
case SET_AUDIO_SETTINGS_VISIBILITY:
return {
...state,
audioSettingsVisible: action.value
};
case SET_VIDEO_SETTINGS_VISIBILITY:
return {
...state,
videoSettingsVisible: action.value
};
}
return state;
});