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

Commit

Permalink
[NEW] Handle endCall and expandView control buttons (#633)
Browse files Browse the repository at this point in the history
* [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>
  • Loading branch information
dhruvjain99 and murtaza98 committed Nov 16, 2021
1 parent a02f241 commit b52f484
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
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, 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 (
<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 }
<div className={createClassName(styles, 'chat__messages', { atBottom, loading })}>
<MessageList
ref={this.handleMessagesContainerRef}
Expand Down

0 comments on commit b52f484

Please sign in to comment.