Skip to content

Commit

Permalink
fix: use forEach method instead of map to change unreadCount
Browse files Browse the repository at this point in the history
  • Loading branch information
khushal87 committed Feb 27, 2022
1 parent d9b3bc8 commit 901502c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG

if (event.type === 'notification.mark_read') {
const activeChannelKeys = Object.keys(this.activeChannels);
activeChannelKeys.map((activeChannelKey) => (this.activeChannels[activeChannelKey].state.unreadCount = 0));
activeChannelKeys.forEach((activeChannelKey) => (this.activeChannels[activeChannelKey].state.unreadCount = 0));
}

if ((event.type === 'channel.deleted' || event.type === 'notification.channel_deleted') && event.cid) {
Expand Down

0 comments on commit 901502c

Please sign in to comment.