Skip to content

Commit 42ad420

Browse files
committed
more cleanup
1 parent c195c46 commit 42ad420

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

apps/web/app/dashboard/_components/Notifications/FilterTabs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export const FilterTabs = ({ activeFilter, setActiveFilter, loading, count }: Fi
6363
? "text-gray-12"
6464
: "text-gray-10 group-hover:text-gray-11"
6565
)}>
66-
{filter === FilterType.ALL ? totalCount : count?.[filter.toLowerCase() as keyof typeof count]}
66+
{filter === FilterType.ALL
67+
? totalCount
68+
: count?.[filter.toLowerCase() as NotificationType] ?? 0}
6769
</p>}
6870
</div>
6971
</div>

apps/web/app/dashboard/_components/Notifications/NotificationItem.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ const descriptionMap: Record<Notification["type"], string> = {
1919
};
2020

2121
export const NotificationItem = ({ notification, className }: NotificationItemProps) => {
22-
const link = notification.type === NotificationType.REPLY || notification.type === NotificationType.COMMENT || notification.type === NotificationType.MENTION || notification.type === NotificationType.REACTION ? `/s/${notification.videoId}/?comment=${notification.data.comment?.id}` : `/s/${notification.videoId}`;
22+
const commentTypes = [
23+
NotificationType.REPLY,
24+
NotificationType.COMMENT,
25+
NotificationType.REACTION
26+
];
27+
const commentId = notification.data?.comment?.id;
28+
const link = commentTypes.includes(notification.type) && commentId
29+
? `/s/${notification.videoId}/?comment=${commentId}`
30+
: `/s/${notification.videoId}`;
2331

2432
return (
2533
<Link href={link}>

0 commit comments

Comments
 (0)