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
|
@ -26,6 +26,7 @@ import type { NotificationGap } from 'mastodon/reducers/notification_groups';
|
|||
import {
|
||||
selectUnreadNotificationGroupsCount,
|
||||
selectPendingNotificationGroupsCount,
|
||||
selectAnyPendingNotification,
|
||||
} from 'mastodon/selectors/notifications';
|
||||
import {
|
||||
selectNeedsNotificationPermission,
|
||||
|
@ -95,7 +96,7 @@ export const Notifications: React.FC<{
|
|||
|
||||
const lastReadId = useAppSelector((s) =>
|
||||
selectSettingsNotificationsShowUnread(s)
|
||||
? s.notificationGroups.lastReadId
|
||||
? s.notificationGroups.readMarkerId
|
||||
: '0',
|
||||
);
|
||||
|
||||
|
@ -105,11 +106,13 @@ export const Notifications: React.FC<{
|
|||
selectUnreadNotificationGroupsCount,
|
||||
);
|
||||
|
||||
const anyPendingNotification = useAppSelector(selectAnyPendingNotification);
|
||||
|
||||
const isUnread = unreadNotificationsCount > 0;
|
||||
|
||||
const canMarkAsRead =
|
||||
useAppSelector(selectSettingsNotificationsShowUnread) &&
|
||||
unreadNotificationsCount > 0;
|
||||
anyPendingNotification;
|
||||
|
||||
const needsNotificationPermission = useAppSelector(
|
||||
selectNeedsNotificationPermission,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue