diff --git a/frontend/app/components/Assist/components/AssistActions/AassistActions.css b/frontend/app/components/Assist/components/AssistActions/AassistActions.css index 303d70241..85f5867c6 100644 --- a/frontend/app/components/Assist/components/AssistActions/AassistActions.css +++ b/frontend/app/components/Assist/components/AssistActions/AassistActions.css @@ -3,4 +3,9 @@ fill: $red } color: $red; +} + +.disabled { + opacity: 0.5; + pointer-events: none; } \ No newline at end of file diff --git a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx index 262a4fc86..b3f16664c 100644 --- a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx +++ b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx @@ -17,18 +17,26 @@ interface Props { peerConnectionStatus: ConnectionStatus } -function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus }: Props) { - const [showChat, setShowChat] = useState(false) +function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus }: Props) { const [ incomeStream, setIncomeStream ] = useState(null); const [ localStream, setLocalStream ] = useState(null); const [ endCall, setEndCall ] = useState<()=>void>(()=>{}); + const [ disconnected, setDisconnected ] = useState(false); useEffect(() => { return endCall }, []) + useEffect(() => { + console.log('peerConnectionStatus', peerConnectionStatus) + if (peerConnectionStatus == 4) { + toast.info(`Live session is closed.`); + setDisconnected(true) + } + }, [peerConnectionStatus]) + function onClose(stream) { - stream.getTracks().forEach(t=>t.stop()); + stream.getTracks().forEach(t=>t.stop()); } function onReject() { @@ -39,8 +47,6 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus toast.error(`Something went wrong!`); } - console.log('peerConnectionStatus', peerConnectionStatus) - function call() { navigator.mediaDevices.getUserMedia({video:true, audio:true}) .then(lStream => { @@ -62,7 +68,13 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus diff --git a/frontend/app/components/BugFinder/LiveSessionList/LiveSessionList.tsx b/frontend/app/components/BugFinder/LiveSessionList/LiveSessionList.tsx index ee282f453..b82e80139 100644 --- a/frontend/app/components/BugFinder/LiveSessionList/LiveSessionList.tsx +++ b/frontend/app/components/BugFinder/LiveSessionList/LiveSessionList.tsx @@ -20,8 +20,7 @@ function LiveSessionList(props: Props) { props.fetchLiveList(); }, []) - useEffect(() => { - console.log(filters) + useEffect(() => { if (filters) { const userIdFilter = filters.filter(i => i.key === 'USERID').first() if (userIdFilter)