Skip to content

Commit

Permalink
chore: add reason for cancel call click button (#1577)
Browse files Browse the repository at this point in the history
Note: Ideally `CancelCallButton` should have been named generically as
`HangupCallButton`, but would be a breaking change so I did not do it
here
  • Loading branch information
santhoshvai authored Nov 14, 2024
1 parent 38254b3 commit bcac386
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export const RingingCallControls = () => {
<>
<AcceptCallButton disabled={buttonsDisabled} />
<CancelCallButton
onClick={() => call.leave({ reject: true })}
onClick={() => {
const reason = call.isCreatedByMe ? 'cancel' : 'decline';
call.leave({ reject: true, reason });
}}
disabled={buttonsDisabled}
/>
</>
Expand Down

0 comments on commit bcac386

Please sign in to comment.