Skip to content

Commit a4d887e

Browse files
committed
fix: leave call on most call states
1 parent a830601 commit a4d887e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/client/src/events/call.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ export const watchCallEnded = (call: Call) => {
7676
return function onCallEnded() {
7777
const { callingState } = call.state;
7878
if (
79-
callingState === CallingState.RINGING ||
80-
callingState === CallingState.JOINED ||
81-
callingState === CallingState.JOINING
79+
callingState !== CallingState.IDLE &&
80+
callingState === CallingState.LEFT
8281
) {
8382
call.leave({ reason: 'call.ended event received' }).catch((err) => {
8483
call.logger('error', 'Failed to leave call after call.ended ', err);

0 commit comments

Comments
 (0)