Skip to content

Commit

Permalink
fix: don't call stop watch for deleted channel
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Nov 13, 2023
1 parent 5a434f1 commit 1c3ae4f
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 1c3ae4f

Please sign in to comment.