From 85ddfc5e1244bfcf3e52fbdd0568554e68876c32 Mon Sep 17 00:00:00 2001 From: Dhruv Jain <51796498+djcruz93@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:11:59 +0530 Subject: [PATCH] [NEW] Handle endCall and expandView control buttons (#633) * [NEW] Handle endCall and expandView control buttons * [FIX] Lint errors * [FIX] Join Call Button giving call ended even when call inProgress * [FIX] slash omitted in the url * [REF] Remove redundant async keyword * [REF] Use spread operator, set ongoingCall status when expanding * [FIX] String enclosed within double quotes Co-authored-by: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> * [FIX] ongoingCall variable not destructured but used Co-authored-by: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> --- src/components/Calls/CallIFrame.js | 15 +++++++++++++-- src/routes/Chat/component.js | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/Calls/CallIFrame.js b/src/components/Calls/CallIFrame.js index 64bac7d6c..bc68c0ed0 100644 --- a/src/components/Calls/CallIFrame.js +++ b/src/components/Calls/CallIFrame.js @@ -7,8 +7,19 @@ import styles from './styles.scss'; export const CallIframe = () => { - const { token, room } = store.state; - const url = `${ Livechat.client.host }/meet/${ room._id }?token=${ token }`; + const { token, room, incomingCallAlert, ongoingCall } = store.state; + const url = `${ Livechat.client.host }/meet/${ room._id }?token=${ token }&layout=embedded`; + window.handleIframeClose = () => store.setState({ incomingCallAlert: { ...incomingCallAlert, show: false } }); + window.expandCall = () => { + window.open( + `${ Livechat.client.host }/meet/${ room._id }?token=${ token }`, + room._id, + ); + return store.setState({ + incomingCallAlert: { ...incomingCallAlert, show: false }, + ongoingCall: { ...ongoingCall, callStatus: 'ongoingCallInNewTab' }, + }); + }; return (