#Q: Is it possible to get unread count (total and per tab)?

1 messages · Page 1 of 1 (latest)

distant oriole
#

I have this application using the @novu/react. Is it possible to get the total unread count for each tab (and total between all)?

meager token
#

@distant oriole

Is this related to this post?

distant oriole
#

Hello, @meager token , while I still experiment the behavior mentioned on that post, no, this is a separated post.

meager token
#

@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

meager token
#

@distant oriole ping

distant oriole
meager token
#

@distant oriole

Thanks for sharing the code sandbox link. I can reproduce the issue. Sharing the issue with team

meager token
#

@distant oriole

This bug is fixed in @novu/react v3.0.0

Can you please check from your end?