SearchResults: Fix how running searches can be cancelled
Search results are wiped when the user switches to a new tab in the app, but this should only be executed when the search is running. Fortunately, just tracking the ProgressView's status should fix this problem. Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
parent
95ea2be722
commit
33c9a4ead2
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ struct SearchResultsView: View {
|
|||
}
|
||||
.onChange(of: navModel.selectedTab) { tab in
|
||||
// Cancel the search if tab is switched
|
||||
if tab != .search, isSearching {
|
||||
if tab != .search, isSearching, navModel.showSearchProgress {
|
||||
scrapingModel.runningSearchTask?.cancel()
|
||||
dismissSearch()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue