Skip to content

Commit

Permalink
Fix: collapse notification is more than max + 1 (#2597)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Oct 6, 2023
1 parent a1ea200 commit 011a0c6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const NotificationCenter = (): ReactElement => {
const canExpand = notifications.length > NOTIFICATION_CENTER_LIMIT + 1

const notificationsToShow =
canExpand && showAll ? chronologicalNotifications : chronologicalNotifications.slice(0, NOTIFICATION_CENTER_LIMIT)
showAll || !canExpand ? chronologicalNotifications : chronologicalNotifications.slice(0, NOTIFICATION_CENTER_LIMIT)

const unreadCount = useMemo(() => notifications.filter(({ isRead }) => !isRead).length, [notifications])
const hasUnread = unreadCount > 0
Expand Down

0 comments on commit 011a0c6

Please sign in to comment.