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 b3ba20f commit d69c30cCopy full SHA for d69c30c
examples/SampleApp/src/components/UnreadCountBadge.tsx
@@ -38,8 +38,9 @@ export const ChannelsUnreadCountBadge: React.FC = () => {
38
*/
39
useEffect(() => {
40
const listener = chatClient?.on((e) => {
41
- if (e.total_unread_count !== undefined) {
42
- setUnreadCount(e.total_unread_count);
+ const event = e.me ?? e;
+ if (event.total_unread_count !== undefined) {
43
+ setUnreadCount(event.total_unread_count);
44
} else {
45
const countUnread = Object.values(chatClient.activeChannels).reduce(
46
(count, channel) => count + channel.countUnread(),
0 commit comments