Merge remote-tracking branch 'parent/main' into upstream-20241006

This commit is contained in:
KMY 2024-10-05 09:10:58 +09:00
commit 66bed31dbe
226 changed files with 2688 additions and 1846 deletions

View file

@ -21,6 +21,7 @@ import {
unmountNotifications,
refreshStaleNotificationGroups,
pollRecentNotifications,
shouldGroupNotificationType,
} from 'mastodon/actions/notification_groups';
import {
disconnectTimeline,
@ -205,6 +206,13 @@ function processNewNotification(
groups: NotificationGroupsState['groups'],
notification: ApiNotificationJSON,
) {
if (!shouldGroupNotificationType(notification.type)) {
notification = {
...notification,
group_key: `ungrouped-${notification.id}`,
};
}
const existingGroupIndex = groups.findIndex(
(group) =>
group.type !== 'gap' && group.group_key === notification.group_key,
@ -277,7 +285,7 @@ function processNewNotification(
groups.unshift(existingGroup);
}
} else {
// Create a new group
// We have not found an existing group, create a new one
groups.unshift(createNotificationGroupFromNotificationJSON(notification));
}
}