1
0
Fork 0
forked from gitea/nas

Change group notifications unread markers to only be cleared when focusing/navigating again (#31325)

This commit is contained in:
Claire 2024-08-07 13:12:42 +02:00 committed by GitHub
parent af2aec1a82
commit 6f285bb2a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 3 deletions

View file

@ -27,6 +27,22 @@ export const selectUnreadNotificationGroupsCount = createSelector(
},
);
// Whether there is any unread notification according to the user-facing state
export const selectAnyPendingNotification = createSelector(
[
(s: RootState) => s.notificationGroups.readMarkerId,
(s: RootState) => s.notificationGroups.groups,
],
(notificationMarker, groups) => {
return groups.some(
(group) =>
group.type !== 'gap' &&
group.page_max_id &&
compareId(group.page_max_id, notificationMarker) > 0,
);
},
);
export const selectPendingNotificationGroupsCount = createSelector(
[(s: RootState) => s.notificationGroups.pendingGroups],
(pendingGroups) =>