Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
fix: only show unread badge after dismissal
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Jun 17, 2022
1 parent 67c235f commit 0637f12
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const Notifications = ({ open, toggle, clickAway }: Props): ReactElement => {
const notificationsToShow =
canExpand && showAll ? sortedNotifications : sortedNotifications.slice(0, NOTIFICATION_LIMIT)

const unreadCount = useMemo(() => notifications.filter(({ read }) => !read).length, [notifications])
const unreadCount = useMemo(
() => notifications.filter(({ read, dismissed }) => !read && dismissed).length,
[notifications],
)
const hasUnread = unreadCount > 0

const handleClickBell = () => {
Expand Down

0 comments on commit 0637f12

Please sign in to comment.