mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 10:11:00 +00:00
Fix a few issues with search
This commit is contained in:
parent
a52f0f9fbe
commit
0fb9e60c3f
1 changed files with 18 additions and 11 deletions
|
@ -22,17 +22,24 @@ public struct ExploreView: View {
|
||||||
loadingView
|
loadingView
|
||||||
} else if !viewModel.searchQuery.isEmpty {
|
} else if !viewModel.searchQuery.isEmpty {
|
||||||
if viewModel.isSearching {
|
if viewModel.isSearching {
|
||||||
HStack {}
|
HStack {
|
||||||
.listRowBackground(theme.secondaryBackgroundColor)
|
Spacer()
|
||||||
.listRowSeparator(.hidden)
|
ProgressView()
|
||||||
} else if let results = viewModel.results[viewModel.searchQuery], !results.isEmpty {
|
Spacer()
|
||||||
makeSearchResultsView(results: results)
|
}
|
||||||
} else {
|
.listRowBackground(theme.secondaryBackgroundColor)
|
||||||
EmptyView(iconName: "magnifyingglass",
|
.listRowSeparator(.hidden)
|
||||||
title: "explore.search.empty.title",
|
.id(UUID())
|
||||||
message: "explore.search.empty.message")
|
} else if let results = viewModel.results[viewModel.searchQuery] {
|
||||||
.listRowBackground(theme.secondaryBackgroundColor)
|
if results.isEmpty, !viewModel.isSearching {
|
||||||
.listRowSeparator(.hidden)
|
EmptyView(iconName: "magnifyingglass",
|
||||||
|
title: "explore.search.empty.title",
|
||||||
|
message: "explore.search.empty.message")
|
||||||
|
.listRowBackground(theme.secondaryBackgroundColor)
|
||||||
|
.listRowSeparator(.hidden)
|
||||||
|
} else {
|
||||||
|
makeSearchResultsView(results: results)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if viewModel.allSectionsEmpty {
|
} else if viewModel.allSectionsEmpty {
|
||||||
EmptyView(iconName: "magnifyingglass",
|
EmptyView(iconName: "magnifyingglass",
|
||||||
|
|
Loading…
Reference in a new issue