Unverified Commit 68cb906d authored by Zach Knox's avatar Zach Knox
Browse files

move where the categories and locations are added to filters

parent ded89a92
......@@ -219,15 +219,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
refresh(self, forceUpdate: false)
// Add locations and categories to filters
for f in facilitiesArray {
if(!filters.onlyFromCategories.keys.contains((f.category?.categoryName)!)) {
filters.onlyFromCategories.updateValue(true, forKey: (f.category?.categoryName)!)
}
if(!filters.onlyFromLocations.keys.contains((f.facilityLocation?.building)!)) {
filters.onlyFromLocations.updateValue(true, forKey: (f.facilityLocation?.building)!)
}
}
LocationsList.reloadData()
......@@ -310,6 +302,16 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
}
LocationsList.reloadData()
// Add locations and categories to filters
for f in facilitiesArray {
if(!filters.onlyFromCategories.keys.contains((f.category?.categoryName)!)) {
filters.onlyFromCategories.updateValue(true, forKey: (f.category?.categoryName)!)
}
if(!filters.onlyFromLocations.keys.contains((f.facilityLocation?.building)!)) {
filters.onlyFromLocations.updateValue(true, forKey: (f.facilityLocation?.building)!)
}
}
refreshControl.endRefreshing()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment