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

Commit

Permalink
[FIX] Notify agent on call decline (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvjain99 authored and murtaza98 committed Nov 16, 2021
1 parent b52f484 commit 853399d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Calls/CallNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import { createClassName, getAvatarUrl } from '../helpers';
import styles from './styles.scss';


export const CallNotification = ({ callProvider, callerUsername, url, dispatch, time, rid } = { callProvider: undefined, callerUsername: undefined, dispatch: undefined, time: undefined }) => {
export const CallNotification = ({ callProvider, callerUsername, url, dispatch, time, rid, callId } = { callProvider: undefined, callerUsername: undefined, dispatch: undefined, time: undefined }) => {
const [show, setShow] = useState(true);

const acceptClick = async () => {
setShow(!{ show });
await Livechat.updateCallStatus('inProgress', rid);
await Livechat.updateCallStatus('inProgress', rid, callId);
switch (callProvider) {
case constants.jitsiCallStartedMessageType: {
window.open(url);
Expand All @@ -31,7 +31,8 @@ export const CallNotification = ({ callProvider, callerUsername, url, dispatch,
};

const declineClick = async () => {
await Livechat.updateCallStatus('declined', rid);
await Livechat.updateCallStatus('declined', rid, callId);
await Livechat.notifyCallDeclined(rid);
await dispatch({ incomingCallAlert: null, ongoingCall: { callStatus: 'declined', time: { time } } });
};

Expand Down
1 change: 1 addition & 0 deletions src/lib/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const processCallMessage = async (message) => {
callerUsername: message.u.username,
rid: message.rid,
time: message.ts,
callId: message._id,
},
ongoingCall: {
callStatus: 'ring',
Expand Down

0 comments on commit 853399d

Please sign in to comment.