Skip to content

Commit

Permalink
fix: do not reject from callkit if call is accepted already (#1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshvai authored Jan 22, 2025
1 parent b14bd51 commit 87b76ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-native-sdk/src/utils/push/internal/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
Call,
CallingState,
RxUtils,
StreamVideoClient,
getLogger,
Expand Down Expand Up @@ -112,7 +113,9 @@ export const processCallFromPush = async (
}
await callFromPush.join();
} else if (action === 'decline') {
await callFromPush.leave({ reject: true, reason: 'decline' });
const canReject =
callFromPush.state.callingState === CallingState.RINGING;
await callFromPush.leave({ reject: canReject, reason: 'decline' });
}
} catch (e) {
const logger = getLogger(['processCallFromPush']);
Expand Down

0 comments on commit 87b76ba

Please sign in to comment.