Change group notifications unread markers to only be cleared when focusing/navigating again (#31325)
This commit is contained in:
parent
af2aec1a82
commit
6f285bb2a6
3 changed files with 33 additions and 3 deletions
|
@ -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) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue