Skip to content

Commit

Permalink
fix: reenable usage of ringing filters with useCalls
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshvai committed Dec 11, 2024
1 parent 064cdc8 commit 1dffaed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/client/src/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,12 @@ export class Call {
}
// update the call state with the latest event data
this.state.updateFromCallResponse(event.call);
this.ringingSubject.next(true);
this.watching = true;
this.ringingSubject.next(true);
// we remove the instance from the calls list to enable the following filter in useCalls hook
// const calls = useCalls().filter((c) => c.ringing);
const calls = this.clientStore.calls.filter((c) => c.cid !== this.cid);
this.clientStore.setCalls([this, ...calls]);
await this.applyDeviceConfig(false);
};

Expand Down

0 comments on commit 1dffaed

Please sign in to comment.