From c65b4aef2e54a8d71abedcbfb5116bd9eedf1075 Mon Sep 17 00:00:00 2001 From: Warrick Corfe-Tan Date: Wed, 22 Sep 2021 16:32:08 +1000 Subject: [PATCH] Adding more UI code --- .../session/calling/CallContainer.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ts/components/session/calling/CallContainer.tsx b/ts/components/session/calling/CallContainer.tsx index 3f2f8871d..890a0dccf 100644 --- a/ts/components/session/calling/CallContainer.tsx +++ b/ts/components/session/calling/CallContainer.tsx @@ -35,7 +35,7 @@ const CallWindowHeader = styled.div` `; // TODO: Add proper styling for this -const VideoContainer = styled.div` +const StreamContainer = styled.div` width: 200px; height: 200px; `; @@ -80,9 +80,9 @@ export const CallContainer = () => { // const [callWindowPosition, setCallWindowPosition] = useState(null) // picking a conversation at random to test with - let randConvo = _.sample(conversations) as ConversationModel; - randConvo.callState = 'incoming'; - console.warn({ randConvo }); + const randomConversation = _.sample(conversations) as ConversationModel; + randomConversation.callState = 'incoming'; + console.warn({ randConvo: randomConversation }); const firstCallingConvo = _.first(conversations.filter(convo => convo.callState !== undefined)); @@ -113,6 +113,10 @@ export const CallContainer = () => { const handleEndCall = () => { // call method to end call connection console.warn("ending the call"); + if (firstCallingConvo) { + firstCallingConvo.callState = undefined; + } + setConnectionState(null); } const handleMouseDown = () => { @@ -120,6 +124,10 @@ export const CallContainer = () => { } //#endregion + if (connectionState === null) { + return null; + } + return ( <> {connectionState === 'connecting' ? @@ -130,12 +138,11 @@ export const CallContainer = () => { - { firstCallingConvo ? firstCallingConvo.getName() : 'Group name not found'} + { firstCallingConvo ? firstCallingConvo.getTitle() : 'Group name not found'} - + - @@ -150,7 +157,7 @@ export const CallContainer = () => { } {connectionState === 'incoming' ? - +