From 7184119e5f8999368593918f19eb3b73e9622e16 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Sat, 4 Dec 2021 02:58:55 +0530 Subject: [PATCH] fix(ui) - compile errors after merge --- .../components/Assist/ChatControls/ChatControls.tsx | 1 - .../app/components/Assist/ChatWindow/ChatWindow.tsx | 12 ++++++------ .../components/AssistActions/AssistActions.tsx | 5 +++-- .../MessageDistributor/managers/AssistManager.ts | 10 +--------- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/frontend/app/components/Assist/ChatControls/ChatControls.tsx b/frontend/app/components/Assist/ChatControls/ChatControls.tsx index 3ddee01dd..61803bc2f 100644 --- a/frontend/app/components/Assist/ChatControls/ChatControls.tsx +++ b/frontend/app/components/Assist/ChatControls/ChatControls.tsx @@ -13,7 +13,6 @@ interface Props { } function ChatControls({ stream, endCall, videoEnabled, setVideoEnabled } : Props) { const [audioEnabled, setAudioEnabled] = useState(true) - const [videoEnabled, setVideoEnabled] = useState(false) const toggleAudio = () => { if (!stream) { return; } diff --git a/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx b/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx index 1851b8a72..0327b8254 100644 --- a/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx +++ b/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx @@ -10,21 +10,21 @@ import type { LocalStream } from 'Player/MessageDistributor/managers/LocalStream export interface Props { - remoteStream: MediaStream | null, + incomeStream: MediaStream | null, localStream: LocalStream | null, userId: String, endCall: () => void } -const ChatWindow: FC = function ChatWindow({ userId, remoteStream, localStream, endCall }) { +const ChatWindow: FC = function ChatWindow({ userId, incomeStream, localStream, endCall }) { const [localVideoEnabled, setLocalVideoEnabled] = useState(false) const [remoteVideoEnabled, setRemoteVideoEnabled] = useState(false) useEffect(() => { - if (!remoteStream) { return } + if (!incomeStream) { return } const iid = setInterval(() => { - const settings = remoteStream.getVideoTracks()[0]?.getSettings() + const settings = incomeStream.getVideoTracks()[0]?.getSettings() const isDummyVideoTrack = !!settings ? (settings.width === 2 || settings.frameRate === 0) : true console.log(isDummyVideoTrack, settings) const shouldBeEnabled = !isDummyVideoTrack @@ -33,7 +33,7 @@ const ChatWindow: FC = function ChatWindow({ userId, remoteStream, localS } }, 1000) return () => clearInterval(iid) - }, [ remoteStream, localVideoEnabled ]) + }, [ incomeStream, localVideoEnabled ]) const minimize = !localVideoEnabled && !remoteVideoEnabled @@ -48,7 +48,7 @@ const ChatWindow: FC = function ChatWindow({ userId, remoteStream, localS
- +
diff --git a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx index f75b7e740..fd0505e7f 100644 --- a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx +++ b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx @@ -38,7 +38,7 @@ interface Props { } function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus, remoteControlEnabled, hasPermission, isEnterprise }: Props) { - const [ remoteStream, setRemoteStream ] = useState(null); + const [ incomeStream, setIncomeStream ] = useState(null); const [ localStream, setLocalStream ] = useState(null); const [ callObject, setCallObject ] = useState<{ end: ()=>void, toggleRemoteControl: ()=>void } | null >(null); @@ -63,6 +63,7 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus onError )); }).catch(onError) + } const confirmCall = async () => { if (await confirm({ @@ -124,7 +125,7 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
}
- { inCall && callObject && } + { inCall && callObject && }
) diff --git a/frontend/app/player/MessageDistributor/managers/AssistManager.ts b/frontend/app/player/MessageDistributor/managers/AssistManager.ts index 421185bb0..f11c0c70a 100644 --- a/frontend/app/player/MessageDistributor/managers/AssistManager.ts +++ b/frontend/app/player/MessageDistributor/managers/AssistManager.ts @@ -118,7 +118,7 @@ function resolveCSS(baseURL: string, css: string): string { } export default class AssistManager { - constructor(private session, private config, private md: MessageDistributor, private config) {} + constructor(private session, private md: MessageDistributor, private config) {} private setStatus(status: ConnectionStatus) { if (status === ConnectionStatus.Connecting) { @@ -403,14 +403,6 @@ export default class AssistManager { } } - private onMouseClick = (e: MouseEvent): void => { - const conn = this.dataConnection; - if (!conn) { return; } - const data = this.md.getInternalCoordinates(e); - // const el = this.md.getElementFromPoint(e); // requires requestiong node_id from domManager - conn.send({ type: "click", x: Math.round(data.x), y: Math.round(data.y) }); - } - private localCallData: { localStream: LocalStream, onStream: (s: MediaStream)=>void,