#Q: Is it possible to get unread count (total and per tab)?
1 messages · Page 1 of 1 (latest)
Hello, @meager token , while I still experiment the behavior mentioned on that post, no, this is a separated post.
@distant oriole
You can use useCounts hook multiple times with required filters
An example 👇🏻
const { counts: unreadCountForTab1, refetch: refetchUnreadCountForTab1 } =
useCounts({
filters: [{ read: false, tags: ["tab1"] }],
});
const { counts: unreadCountForTab2, refetch: refetchUnreadCountForTab2 } =
useCounts({
filters: [{ read: false, tags: ["tab2"] }],
});
const { counts: totalUnreadCount, refetch: refetchTotalUnreadCount } =
useCounts({
filters: [{ read: false }],
});
Let me know if you are facing any issue
@distant oriole ping
Hello, sorry for late reply, normally i don't have discord notifications turned on, but i have turned them on now.
I don't seem to be able to use the useCount when passing tags to the filters array. Take a look: https://codesandbox.io/p/devbox/novu-no-tabs-forked-js33ll?workspaceId=ws_7SUJy9312Hx95pVV2BTHfM
@meager token
@distant oriole
Thanks for sharing the code sandbox link. I can reproduce the issue. Sharing the issue with team
@distant oriole
This bug is fixed in @novu/react v3.0.0
Can you please check from your end?