Only show archived categories section when there actually are archived categories
This commit is contained in:
parent
20b685809b
commit
56bca7f0ad
1 changed files with 5 additions and 3 deletions
|
@ -27,9 +27,11 @@ struct CategoryListView: View {
|
|||
CategoryListItemView(CategoryDataStore(dataStore.apiService), budget: budget, category: category)
|
||||
}
|
||||
}
|
||||
Section("Archived") {
|
||||
ForEach(categories.filter { $0.archived }) { category in
|
||||
CategoryListItemView(CategoryDataStore(dataStore.apiService), budget: budget, category: category)
|
||||
if categories.contains(where: { $0.archived }) {
|
||||
Section("Archived") {
|
||||
ForEach(categories.filter { $0.archived }) { category in
|
||||
CategoryListItemView(CategoryDataStore(dataStore.apiService), budget: budget, category: category)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue