wasabi
wasabi
NNovu
Created by wasabi on 3/3/2025 in #💬│support
Bell count and count next to tab name it's not updating
Thank you, @Pawan Jain , that was my issue. Everything works now, I'm glad you helped me. PS: the useCount post i created at https://discord.com/channels/895029566685462578/1346961569216462988, still not working, i'm willing to help on that or submit a PR.
13 replies
NNovu
Created by wasabi on 3/3/2025 in #💬│support
Bell count and count next to tab name it's not updating
I guess my specific question is, when self hosting novu, how to setup websocket url?
13 replies
NNovu
Created by wasabi on 3/3/2025 in #💬│support
Bell count and count next to tab name it's not updating
Where can I see the docs on this socketUrl implementation? Should I use the same url as backendUrl? @Pawan Jain
13 replies
NNovu
Created by wasabi on 3/5/2025 in #💬│support
Q: Is it possible to get unread count (total and per tab)?
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 @Pawan Jain
8 replies
NNovu
Created by wasabi on 3/5/2025 in #💬│support
Q: Is it possible to get unread count (total and per tab)?
Hello, @Pawan Jain , while I still experiment the behavior mentioned on that post, no, this is a separated post.
8 replies
NNovu
Created by wasabi on 3/3/2025 in #💬│support
what's up with your docs?
@Pawan Jain https://docs.novu.co/platform/inbox/react/hooks#bell-button-with-unread-count too, mentions a useUnreadCount imported from @novu/react. Which it's not there: from @novu/react/dist/client/index.d.ts:
export { type BaseProps, Bell, type BellProps, type BellRenderer, type DefaultInboxProps, type DefaultProps, Inbox, InboxContent, type InboxContentProps, type InboxProps, InternalNovuProvider, type NotificationProps, Notifications, type NotificationsRenderer, NovuProvider, Preferences, type UseNotificationsProps, type WithChildrenProps, useCounts, useNotifications, useNovu, usePreferences, useUnsafeNovu };
export { type BaseProps, Bell, type BellProps, type BellRenderer, type DefaultInboxProps, type DefaultProps, Inbox, InboxContent, type InboxContentProps, type InboxProps, InternalNovuProvider, type NotificationProps, Notifications, type NotificationsRenderer, NovuProvider, Preferences, type UseNotificationsProps, type WithChildrenProps, useCounts, useNotifications, useNovu, usePreferences, useUnsafeNovu };
6 replies
NNovu
Created by wasabi on 3/3/2025 in #💬│support
Bell count and count next to tab name it's not updating
Oh, i'm sorry. My bad. @Pawan Jain
import { Notification as NovuNotification } from "@novu/react";

type NotificationItemProps = {
notification: NovuNotification;
};

export const CustomNotificationItem = ({
notification: notificationInfo,
}: NotificationItemProps): React.ReactElement => {
const handleOnClick = (): void => {
void notificationInfo.read();
};
return (
<div>
{notificationInfo.subject}
<button onClick={handleOnClick}>mark as read</button>
</div>
);
};
import { Notification as NovuNotification } from "@novu/react";

type NotificationItemProps = {
notification: NovuNotification;
};

export const CustomNotificationItem = ({
notification: notificationInfo,
}: NotificationItemProps): React.ReactElement => {
const handleOnClick = (): void => {
void notificationInfo.read();
};
return (
<div>
{notificationInfo.subject}
<button onClick={handleOnClick}>mark as read</button>
</div>
);
};
13 replies
NNovu
Created by wasabi on 3/3/2025 in #💬│support
Bell count and count next to tab name it's not updating
Sure,
import { Notification as NovuNotification } from "@novu/react";

type CustomNotificationListProps = {
notifications: NovuNotification[];
isLoading: boolean;
onNotificationRead?: (notification: NovuNotification) => void;
};

export const CustomNotificationList = ({
notifications,
isLoading,
onNotificationRead,
}: CustomNotificationListProps): React.ReactElement => {
const handleOnClick = (notification: NovuNotification): void => {
void notification.read();
};

return (
<div>
{notifications.map((notification) => (
<div onClick={(): void => handleOnClick(notification)}>
{notification.subject}
</div>
))}
</div>
);
};
import { Notification as NovuNotification } from "@novu/react";

type CustomNotificationListProps = {
notifications: NovuNotification[];
isLoading: boolean;
onNotificationRead?: (notification: NovuNotification) => void;
};

export const CustomNotificationList = ({
notifications,
isLoading,
onNotificationRead,
}: CustomNotificationListProps): React.ReactElement => {
const handleOnClick = (notification: NovuNotification): void => {
void notification.read();
};

return (
<div>
{notifications.map((notification) => (
<div onClick={(): void => handleOnClick(notification)}>
{notification.subject}
</div>
))}
</div>
);
};
13 replies