Files
jitsi-meet/react/features/desktop-picker/reducer.ts
Duduman Bogdan Vlad 8a2e4bc628 feat(screenshare) - add web security fix for electron (#13096)
use send the share screen sources using the external api

---------

Co-authored-by: Gabriel Borlea <gabriel.borlea@8x8.com>
2023-10-16 14:59:55 +03:00

35 lines
819 B
TypeScript

import ReducerRegistry from '../base/redux/ReducerRegistry';
import { DELETE_DESKTOP_SOURCES, SET_DESKTOP_SOURCES } from './actionTypes';
import { IDesktopSources } from './types';
/**
* The initial state of the web-hid feature.
*/
const DEFAULT_STATE: IDesktopPicker = {
sources: {} as IDesktopSources
};
export interface IDesktopPicker {
sources: IDesktopSources;
}
ReducerRegistry.register<IDesktopPicker>(
'features/desktop-picker',
(state: IDesktopPicker = DEFAULT_STATE, action): IDesktopPicker => {
switch (action.type) {
case SET_DESKTOP_SOURCES:
return {
...state,
sources: action.sources
};
case DELETE_DESKTOP_SOURCES:
return {
...state,
...DEFAULT_STATE
};
default:
return state;
}
});