Skip to content

Commit

Permalink
[CJS-13] Fix flickering and out-of-order events on truncate.channel w…
Browse files Browse the repository at this point in the history
…ith system message (#870)

* add message present in truncate channel events

* remove else branch for pinned messages
  • Loading branch information
thesyncim authored and ffenix113 committed Jan 20, 2022
1 parent b77d1e9 commit 2a57440
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,13 @@ export class Channel<
case 'channel.truncated':
channelState.clearMessages();
channelState.unreadCount = 0;
// system messages don't increment unread counts
if (event.message) {
channelState.addMessageSorted(event.message);
if (event.message.pinned) {
channelState.addPinnedMessage(event.message);
}
}
break;
case 'member.added':
case 'member.updated':
Expand Down

0 comments on commit 2a57440

Please sign in to comment.