Refactor screen share picker internals

This commit is contained in:
Fedor Indutny
2024-09-19 18:03:44 -07:00
committed by GitHub
parent 855b1c03b0
commit d0b8a2991f
25 changed files with 547 additions and 244 deletions
+4 -5
View File
@@ -29,7 +29,6 @@ import type {
ActiveCallReactionsType,
ConversationsByDemuxIdType,
GroupCallVideoRequest,
PresentedSource,
} from '../types/Calling';
import {
CALLING_REACTIONS_LIFETIME,
@@ -97,6 +96,7 @@ export type PropsType = {
activeCall: ActiveCallType;
approveUser: (payload: PendingUserActionPayloadType) => void;
batchUserAction: (payload: BatchUserActionPayloadType) => void;
cancelPresenting: () => void;
denyUser: (payload: PendingUserActionPayloadType) => void;
getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource;
getPresentingSources: () => void;
@@ -120,7 +120,6 @@ export type PropsType = {
setLocalAudio: (_: SetLocalAudioType) => void;
setLocalVideo: (_: SetLocalVideoType) => void;
setLocalPreview: (_: SetLocalPreviewType) => void;
setPresenting: (_?: PresentedSource) => void;
setRendererCanvas: (_: SetRendererCanvasType) => void;
stickyControls: boolean;
switchToPresentationView: () => void;
@@ -190,6 +189,7 @@ export function CallScreen({
activeCall,
approveUser,
batchUserAction,
cancelPresenting,
changeCallView,
denyUser,
getGroupCallVideoFrameSource,
@@ -210,7 +210,6 @@ export function CallScreen({
setLocalAudio,
setLocalVideo,
setLocalPreview,
setPresenting,
setRendererCanvas,
stickyControls,
switchToPresentationView,
@@ -260,11 +259,11 @@ export function CallScreen({
const togglePresenting = useCallback(() => {
if (presentingSource) {
setPresenting();
cancelPresenting();
} else {
getPresentingSources();
}
}, [getPresentingSources, presentingSource, setPresenting]);
}, [getPresentingSources, presentingSource, cancelPresenting]);
const hangUp = useCallback(() => {
hangUpActiveCall('button click');