Commit 9f246fb2a7
Unsigned
Layout: unified · split
Hutch/Views/Repositories/RepositoryListViewModel.swift +4 −1
| @@ -189,7 +189,10 @@ final class RepositoryListViewModel { | ||
| 189 | 189 | filteredResults = [] |
| 190 | 190 | } |
| 191 | 191 | } else { |
| 192 | let repositories = try await fetchAllRepositories(useCache: true) | |
| 192 | // forceRefresh used to reach only the build statuses, so a pull to | |
| 193 | // refresh re-served the cached list and a deleted repository stayed | |
| 194 | // on screen. | |
| 195 | let repositories = try await fetchAllRepositories(useCache: !forceRefresh) | |
| 193 | 196 | updateSearchIndex(with: repositories) |
| 194 | 197 | filteredResults = repositories |
| 195 | 198 | } |
Hutch/Views/Repositories/RepositorySettingsViewModel.swift +5
| @@ -231,6 +231,11 @@ final class RepositorySettingsViewModel { | ||
| 231 | 231 | variables: ["id": repositoryId], |
| 232 | 232 | responseType: DeleteRepositoryResponse.self |
| 233 | 233 | ) |
| 234 | // The list and Home are both served from cache, so without this the | |
| 235 | // repository lingers on screen after it no longer exists. Creation | |
| 236 | // already does this; deletion never did. | |
| 237 | await client.invalidateCache(prefix: APICacheKeys.prefix(service.rawValue, "repositories")) | |
| 238 | await client.invalidateCache(prefix: APICacheKeys.prefix("home")) | |
| 234 | 239 | didDelete = true |
| 235 | 240 | } catch { |
| 236 | 241 | self.error = error.userFacingMessage |