1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/stable-4.3' into upstream-20241005

This commit is contained in:
KMY 2024-10-05 09:02:38 +09:00
commit cc857e57c6
132 changed files with 775 additions and 312 deletions

View file

@ -37,8 +37,7 @@ export const synchronouslySubmitMarkers = createAppAsyncThunk(
});
return;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if ('navigator' && 'sendBeacon' in navigator) {
} else if ('sendBeacon' in navigator) {
// Failing that, we can use sendBeacon, but we have to encode the data as
// FormData for DoorKeeper to recognize the token.
const formData = new FormData();

View file

@ -74,6 +74,10 @@ const supportedGroupedNotificationTypes = [
'emoji_reaction',
];
export function shouldGroupNotificationType(type: string) {
return supportedGroupedNotificationTypes.includes(type);
}
export const fetchNotifications = createDataLoadingThunk(
'notificationGroups/fetch',
async (_params, { getState }) =>

View file

@ -212,7 +212,7 @@ class Item extends PureComponent {
{visible && thumbnail}
{badges && (
{visible && badges && (
<div className='media-gallery__item__badges'>
{badges}
</div>

View file

@ -520,7 +520,7 @@ export default function compose(state = initialState, action) {
.set('isUploadingThumbnail', false)
.update('media_attachments', list => list.map(item => {
if (item.get('id') === action.media.id) {
return fromJS(action.media);
return fromJS(action.media).set('unattached', item.get('unattached'));
}
return item;

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));
}
}