From 58debff49075a809e3bc1032cd011f1599092595 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Tue, 18 Jul 2023 08:04:18 +0200 Subject: [PATCH] Fix explore view loading state Fix #1395 --- .../Explore/Sources/Explore/ExploreView.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Packages/Explore/Sources/Explore/ExploreView.swift b/Packages/Explore/Sources/Explore/ExploreView.swift index ad11387d..32abf0ae 100644 --- a/Packages/Explore/Sources/Explore/ExploreView.swift +++ b/Packages/Explore/Sources/Explore/ExploreView.swift @@ -21,16 +21,7 @@ public struct ExploreView: View { if !viewModel.isLoaded { loadingView } else if !viewModel.searchQuery.isEmpty { - if viewModel.isSearching { - HStack { - Spacer() - ProgressView() - Spacer() - } - .listRowBackground(theme.secondaryBackgroundColor) - .listRowSeparator(.hidden) - .id(UUID()) - } else if let results = viewModel.results[viewModel.searchQuery] { + if let results = viewModel.results[viewModel.searchQuery] { if results.isEmpty, !viewModel.isSearching { EmptyView(iconName: "magnifyingglass", title: "explore.search.empty.title", @@ -40,6 +31,15 @@ public struct ExploreView: View { } else { makeSearchResultsView(results: results) } + } else { + HStack { + Spacer() + ProgressView() + Spacer() + } + .listRowBackground(theme.secondaryBackgroundColor) + .listRowSeparator(.hidden) + .id(UUID()) } } else if viewModel.allSectionsEmpty { EmptyView(iconName: "magnifyingglass",