Skip to content

Commit b177a93

Browse files
committed
fix(app): mark all as read in every sidebar ordering
1 parent 3a5ab0f commit b177a93

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎packages/app/src/shell/titlebar/sidebar-customized.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,15 +548,16 @@ export function SidebarCustomized(props: {
548548
on ? [...new Set([...values, value])] : values.filter((item) => item !== value),
549549
)
550550

551+
// Row status is only worked out when it changes the view, so read the unread state directly.
552+
const isUnread = (row: Row) =>
553+
!!row.session && !!ctxOf(row.server)?.notification.session.unread(row.session.id, row.session)
554+
551555
const markAllRead = () =>
552556
visibleRows().forEach((row) => {
553-
if (row.session && row.status === "unread") ctxOf(row.server)?.notification.session.markViewed(row.session.id)
557+
if (row.session && isUnread(row)) ctxOf(row.server)?.notification.session.markViewed(row.session.id)
554558
})
555559

556-
const anyUnread = () =>
557-
visibleRows().some(
558-
(row) => row.session && ctxOf(row.server)?.notification.session.unread(row.session.id, row.session),
559-
)
560+
const anyUnread = () => visibleRows().some(isUnread)
560561

561562
const filterCount = () => local.filters.status.length + local.filters.server.length + local.filters.project.length
562563

0 commit comments

Comments
 (0)