diff options
| author | Christian Cleberg <[email protected]> | 2026-04-01 11:52:40 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-01 11:52:40 -0500 |
| commit | c22287d5e256f5b23528114c5efec63069f9c2b5 (patch) | |
| tree | a22cda1ff6985ac151d2e9a36805d4cd8e3d6554 | |
| parent | 5845fc53b9c81532e552dc3512347e20de0f2090 (diff) | |
| download | hutch-c22287d5e256f5b23528114c5efec63069f9c2b5.tar.gz hutch-c22287d5e256f5b23528114c5efec63069f9c2b5.tar.bz2 hutch-c22287d5e256f5b23528114c5efec63069f9c2b5.zip | |
fix: ensure projects in Home tab are sorted by last updated date
| -rw-r--r-- | Hutch/Models/Project.swift | 1 | ||||
| -rw-r--r-- | Hutch/Networking/ProjectService.swift | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Hutch/Models/Project.swift b/Hutch/Models/Project.swift index e6726c2..2cd8e00 100644 --- a/Hutch/Models/Project.swift +++ b/Hutch/Models/Project.swift @@ -65,6 +65,7 @@ struct Project: Identifiable, Hashable, Sendable { let website: String? let visibility: Visibility let tags: [String] + let updated: Date let mailingLists: [MailingList] let sources: [SourceRepo] let trackers: [Tracker] diff --git a/Hutch/Networking/ProjectService.swift b/Hutch/Networking/ProjectService.swift index 2afb699..a76d1d7 100644 --- a/Hutch/Networking/ProjectService.swift +++ b/Hutch/Networking/ProjectService.swift @@ -20,6 +20,7 @@ private struct ProjectSummaryPayload: Decodable, Sendable { let website: String? let visibility: Visibility let tags: [String] + let updated: Date } private struct ProjectDetailResponse: Decodable, Sendable { @@ -92,6 +93,7 @@ struct ProjectService: Sendable { website visibility tags + updated } cursor } @@ -162,7 +164,7 @@ struct ProjectService: Sendable { for try await project in group { projects.append(project) } - return projects.sorted { $0.name.localizedCaseInsensitiveCompare($1.name) == .orderedAscending } + return projects.sorted { $0.updated > $1.updated } } } @@ -267,6 +269,7 @@ struct ProjectService: Sendable { website: project.website, visibility: project.visibility, tags: project.tags, + updated: summary.updated, mailingLists: deduplicate(mailingLists), sources: deduplicate(sources), trackers: deduplicate(trackers) |
