stream-chat-angular 6.0.0-beta.1 → 6.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ import transliterate from '@stream-io/transliterate';
20
20
  import * as i8$1 from 'angular-mentions';
21
21
  import { MentionModule } from 'angular-mentions';
22
22
 
23
- const version = '6.0.0-beta.1';
23
+ const version = '6.0.0-beta.2';
24
24
 
25
25
  /**
26
26
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications.
@@ -1439,8 +1439,16 @@ class ChannelService {
1439
1439
  this.channelQueryStateSubject.next({ state: 'in-progress' });
1440
1440
  if (this.customChannelQuery) {
1441
1441
  const result = await this.customChannelQuery(queryType);
1442
- const currentChannels = this.channels;
1443
- const filteredChannels = result.channels.filter((channel, index) => !currentChannels.slice(0, index).find((c) => c.cid === channel.cid));
1442
+ const cids = new Set();
1443
+ const filteredChannels = result.channels.filter((c) => {
1444
+ if (cids.has(c.cid)) {
1445
+ return false;
1446
+ }
1447
+ else {
1448
+ cids.add(c.cid);
1449
+ return true;
1450
+ }
1451
+ });
1444
1452
  this.channelManager.setChannels(filteredChannels);
1445
1453
  this.hasMoreChannelsSubject.next(result.hasMorePage);
1446
1454
  }