Timeline: Fixes

This commit is contained in:
Thomas Ricouard 2024-01-03 12:33:06 +01:00
parent 2e23b08b88
commit 1bdd31e848
2 changed files with 5 additions and 1 deletions

View file

@ -91,7 +91,10 @@ import SwiftUI
private func fetchTag(id: String) async {
guard let client else { return }
do {
tag = try await client.get(endpoint: Tags.tag(id: id))
let tag: Tag = try await client.get(endpoint: Tags.tag(id: id))
withAnimation {
self.tag = tag
}
} catch {}
}

View file

@ -71,6 +71,7 @@ public actor TimelineCache {
}
func setLatestSeenStatuses(_ statuses: [Status], for client: Client, filter: String) {
var statuses = statuses.sorted(by: { $0.createdAt.asDate > $1.createdAt.asDate })
if filter == "Home" {
UserDefaults.standard.set(statuses.map{ $0.id }, forKey: "timeline-last-seen-\(client.id)")
} else {