mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Revert "Add loading status to vertical cells"
This reverts commit c6cff4dee4
.
This commit is contained in:
@@ -244,12 +244,22 @@ struct SearchView: View {
|
||||
if showRecentQueries {
|
||||
recentQueries
|
||||
} else {
|
||||
VerticalCells(items: state.store.collection, isLoading: state.isLoading) {
|
||||
VerticalCells(items: state.store.collection, allowEmpty: state.query.isEmpty) {
|
||||
if shouldDisplayHeader {
|
||||
header
|
||||
}
|
||||
}
|
||||
.environment(\.loadMoreContentHandler) { state.loadNextPage() }
|
||||
|
||||
if noResults {
|
||||
Text("No results")
|
||||
|
||||
if searchFiltersActive {
|
||||
Button("Reset search filters", action: resetFilters)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,6 +280,12 @@ struct SearchView: View {
|
||||
searchDuration != .any || searchDate != .any
|
||||
}
|
||||
|
||||
private func resetFilters() {
|
||||
searchSortOrder = .relevance
|
||||
searchDate = .any
|
||||
searchDuration = .any
|
||||
}
|
||||
|
||||
private var noResults: Bool {
|
||||
state.store.collection.isEmpty && !state.isLoading && !state.query.isEmpty
|
||||
}
|
||||
|
Reference in New Issue
Block a user