Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[NEW] Handle endCall and expandView control buttons #633

15 changes: 13 additions & 2 deletions src/components/Calls/CallIFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = 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" },
dhruvjain99 marked this conversation as resolved.
Show resolved Hide resolved
});
};
return (
<div className={createClassName(styles, 'call-iframe')}>
<iframe className={createClassName(styles, 'call-iframe__content')} allow='camera;microphone' src={url} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Chat/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default class Chat extends Component {
>
<Screen.Content nopadding>
{ incomingCallAlert && !!incomingCallAlert.show && <CallNotification { ...incomingCallAlert } dispatch={dispatch} />}
{ ongoingCall && ongoingCall.callStatus === 'accept' ? <CallIframe { ...incomingCallAlert } /> : null }
{ incomingCallAlert?.show && ongoingCall && ongoingCall.callStatus === 'accept' ? <CallIframe { ...incomingCallAlert } /> : null }
murtaza98 marked this conversation as resolved.
Show resolved Hide resolved
<div className={createClassName(styles, 'chat__messages', { atBottom, loading })}>
<MessageList
ref={this.handleMessagesContainerRef}
Expand Down