Skip to content

Commit

Permalink
Fix: collapse notification is more than max + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Oct 6, 2023
1 parent 998e8f9 commit e1ae146
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 e1ae146

Please sign in to comment.