diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 22:30:22 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 22:30:22 -0500 |
| commit | 54d037548261c1546555a89a6a803b542a769880 (patch) | |
| tree | c99bf489071d40e4acc0d99aae769abc8e614497 /Hutch/Views/Lookup/UserProfileViewModel.swift | |
| parent | 7a875798fea9321bad2636040d9be2c30bc0fa8f (diff) | |
| download | hutch-54d037548261c1546555a89a6a803b542a769880.tar.gz hutch-54d037548261c1546555a89a6a803b542a769880.tar.bz2 hutch-54d037548261c1546555a89a6a803b542a769880.zip | |
feat: add repo settings management
Implements: https://todo.sr.ht/~ccleberg/hutch/42
Implements: https://todo.sr.ht/~ccleberg/hutch/43
Implements: https://todo.sr.ht/~ccleberg/hutch/44
Diffstat (limited to 'Hutch/Views/Lookup/UserProfileViewModel.swift')
| -rw-r--r-- | Hutch/Views/Lookup/UserProfileViewModel.swift | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Hutch/Views/Lookup/UserProfileViewModel.swift b/Hutch/Views/Lookup/UserProfileViewModel.swift index 56c2852..b88d36a 100644 --- a/Hutch/Views/Lookup/UserProfileViewModel.swift +++ b/Hutch/Views/Lookup/UserProfileViewModel.swift @@ -61,6 +61,17 @@ final class UserProfileViewModel { } } + func updateRepository(_ repository: RepositorySummary) { + guard let index = repositories.firstIndex(where: { $0.id == repository.id }) else { return } + repositories[index] = repository + repositories.sort { lhs, rhs in + if lhs.updated == rhs.updated { + return lhs.name.localizedCaseInsensitiveCompare(rhs.name) == .orderedAscending + } + return lhs.updated > rhs.updated + } + } + func loadTrackers() async { isLoadingTrackers = true trackersError = nil |
