fix: sorting of reblogs and favourites in grouped notifications

This commit is contained in:
patak 2022-12-27 21:49:04 +01:00
parent 5c4cd7e992
commit 6388b5287c

View file

@ -70,7 +70,7 @@ function groupItems(items: Notification[]): NotificationSlot[] {
}
like[notification.type === 'reblog' ? 'reblog' : 'favourite'] = notification
}
likes.sort((a, b) => b.reblog && !a.reblog ? 1 : -1)
likes.sort((a, b) => a.reblog ? !b.reblog || (a.favourite && !b.favourite) ? -1 : 0 : 0)
results.push({
id: `grouped-${id++}`,
type: 'grouped-reblogs-and-favourites',