Order notifications by createdAt instead of id

This commit is contained in:
Justin Mazzocchi 2022-05-05 19:31:57 -07:00
parent 3e93ced674
commit f251896198
1 changed files with 1 additions and 1 deletions

View File

@ -564,7 +564,7 @@ public extension ContentDatabase {
excludeTypes: Set<MastodonNotification.NotificationType>) -> AnyPublisher<[CollectionSection], Error> {
ValueObservation.tracking(
NotificationInfo.request(
NotificationRecord.order(NotificationRecord.Columns.id.desc)
NotificationRecord.order(NotificationRecord.Columns.createdAt.desc)
.filter(!excludeTypes.map(\.rawValue).contains(NotificationRecord.Columns.type))).fetchAll)
.removeDuplicates()
.publisher(in: databaseWriter)