05/21 Fix issue's photo problems
This commit is contained in:
@@ -46,10 +46,15 @@ struct StartInspectionView: View {
|
||||
return result.sorted { $0.name < $1.name }
|
||||
}
|
||||
|
||||
/// Facilities that belong to the selected contract.
|
||||
/// Facilities that belong to the selected contract, deduplicated by serverId.
|
||||
/// Guards against duplicate LocalFacility records if the server ever returns
|
||||
/// the same facility id more than once in the /api/v1/facilities response.
|
||||
private var filteredFacilities: [LocalFacility] {
|
||||
guard let pid = selectedProjectId else { return [] }
|
||||
return facilities.filter { $0.projectId == pid }
|
||||
var seen = Set<Int>()
|
||||
return facilities
|
||||
.filter { $0.projectId == pid }
|
||||
.filter { seen.insert($0.serverId).inserted }
|
||||
}
|
||||
|
||||
private var selectedFacility: LocalFacility? {
|
||||
|
||||
Reference in New Issue
Block a user