We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2879810 commit 0f5792bCopy full SHA for 0f5792b
projects/stream-chat-angular/src/lib/channel.service.ts
@@ -499,6 +499,12 @@ export class ChannelService<
499
this.watchForActiveChannelEvents(channel);
500
this.addChannel(channel);
501
this.activeChannelSubject.next(channel);
502
+ const channelStateLength = channel.state.latestMessages.length;
503
+ if (channelStateLength > 2 * this.messagePageSize) {
504
+ channel.state.latestMessages = channel.state.latestMessages.slice(
505
+ channelStateLength - 2 * this.messagePageSize
506
+ );
507
+ }
508
this.setChannelState(channel);
509
}
510
0 commit comments