fix(rn,screensharing) fix build
This commit is contained in:
parent
be93fbd512
commit
4018e8875f
|
@ -20,31 +20,20 @@ export * from './actions.any';
|
||||||
* @returns {Function}
|
* @returns {Function}
|
||||||
*/
|
*/
|
||||||
export function toggleScreensharing(enabled: boolean): Function {
|
export function toggleScreensharing(enabled: boolean): Function {
|
||||||
return (store: IStore) => _toggleScreenSharing(enabled, store);
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
||||||
}
|
const state = getState();
|
||||||
|
|
||||||
/**
|
if (enabled) {
|
||||||
* Toggles screen sharing.
|
const isSharing = isLocalVideoTrackDesktop(state);
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {boolean} enabled - The state to toggle screen sharing to.
|
|
||||||
* @param {Store} store - The redux.
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
function _toggleScreenSharing(enabled: boolean, store: IStore): void {
|
|
||||||
const { dispatch, getState } = store;
|
|
||||||
const state = getState();
|
|
||||||
|
|
||||||
if (enabled) {
|
if (!isSharing) {
|
||||||
const isSharing = isLocalVideoTrackDesktop(state);
|
_startScreenSharing(dispatch, state);
|
||||||
|
}
|
||||||
if (!isSharing) {
|
} else {
|
||||||
_startScreenSharing(dispatch, state);
|
dispatch(destroyLocalDesktopTrackIfExists());
|
||||||
|
setPictureInPictureEnabled(true);
|
||||||
}
|
}
|
||||||
} else {
|
};
|
||||||
dispatch(destroyLocalDesktopTrackIfExists());
|
|
||||||
setPictureInPictureEnabled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue