summaryrefslogtreecommitdiff
path: root/Hutch/Views/Home/HomeViewModel.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-16 10:13:46 -0500
committerChristian Cleberg <[email protected]>2026-07-16 10:13:46 -0500
commit65412ee9818bf251fd5caac231746b04c7eca23f (patch)
tree06a6e5e26d6b00fb4c1e27587682006d21b9fd0b /Hutch/Views/Home/HomeViewModel.swift
parent6a26c6de827e56a57d9a8c600b26354e280df383 (diff)
downloadhutch-65412ee9818bf251fd5caac231746b04c7eca23f.tar.gz
hutch-65412ee9818bf251fd5caac231746b04c7eca23f.tar.bz2
hutch-65412ee9818bf251fd5caac231746b04c7eca23f.zip
fix: honor forceRefresh for projects and system status on the dashboard
loadDashboard(forceRefresh:) fanned the flag out to five loaders, but loadProjects and loadSystemStatusSnapshot dropped it: they called fetchProjects() and snapshotResult() with no policy, so pull-to-refresh returned cached projects and status while the other three sections refreshed. SonarCloud flagged both params as unused (swift:S1172). Thread forceRefresh through ProjectService.fetchProjects into the page policy (refreshIgnoringCache when forced), and pass it to snapshotResult, which already accepted it. ProjectsListView carried the same latent bug via its own .refreshable — fixed there too now that fetchProjects can force.
Diffstat (limited to 'Hutch/Views/Home/HomeViewModel.swift')
-rw-r--r--Hutch/Views/Home/HomeViewModel.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/Hutch/Views/Home/HomeViewModel.swift b/Hutch/Views/Home/HomeViewModel.swift
index a3aed30..3789c11 100644
--- a/Hutch/Views/Home/HomeViewModel.swift
+++ b/Hutch/Views/Home/HomeViewModel.swift
@@ -683,7 +683,7 @@ final class HomeViewModel {
private func loadProjects(forceRefresh: Bool) async -> Result<[Project], Error> {
do {
- return .success(try await projectService.fetchProjects())
+ return .success(try await projectService.fetchProjects(forceRefresh: forceRefresh))
} catch {
return .failure(error)
}
@@ -716,7 +716,7 @@ final class HomeViewModel {
private func loadSystemStatusSnapshot(forceRefresh: Bool) async -> Result<CachedSystemStatusValue<SystemStatusSnapshot>, Error> {
do {
- return .success(try await systemStatusRepository.snapshotResult())
+ return .success(try await systemStatusRepository.snapshotResult(forceRefresh: forceRefresh))
} catch {
return .failure(error)
}