Skip to content

Commit

Permalink
Merge pull request #502 from GetStream/do-not-call-stop-watch-for-del…
Browse files Browse the repository at this point in the history
…eted-channel

fix: don't call stop watch for deleted channel
  • Loading branch information
szuperaz authored Nov 13, 2023
2 parents 5a434f1 + 1c3ae4f commit 515d3e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ describe('ChannelService', () => {
const channels = spy.calls.mostRecent().args[0] as Channel[];

expect(channels.find((c) => c.cid === channel.cid)).toBeUndefined();
expect(channel.stopWatching).toHaveBeenCalledWith();
expect(channel.stopWatching).not.toHaveBeenCalledWith();
});

it('should call #customChannelDeletedHandler, if channel is deleted and handler is provided', async () => {
Expand Down
2 changes: 1 addition & 1 deletion projects/stream-chat-angular/src/lib/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ export class ChannelService<
}

private handleChannelDeleted(event: Event) {
this.removeChannelsFromChannelList([event.channel!.cid], true);
this.removeChannelsFromChannelList([event.channel!.cid], false);
}

private handleChannelVisible(event: Event, channel: Channel<T>) {
Expand Down

0 comments on commit 515d3e9

Please sign in to comment.