Merge pull request #1625 from omnivore-app/fix/ios-search-if-no-items

Fall back to using search instead of just sync API if no items found
This commit is contained in:
Jackson Harper 2023-01-09 12:01:58 +08:00 committed by GitHub
commit c80736c7b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 8 additions and 7 deletions

View file

@ -194,13 +194,14 @@ import Views
await group.waitForAll()
}
if searchTerm.replacingOccurrences(of: " ", with: "").isEmpty {
updateFetchController(dataService: dataService)
if appliedFilter != LinkedItemFilter.inbox.rawValue || !isRefresh {
await loadSearchQuery(dataService: dataService, isRefresh: isRefresh)
}
} else {
let shouldSearch = items.count < 1 || isRefresh
if shouldSearch {
await loadSearchQuery(dataService: dataService, isRefresh: isRefresh)
} else {
updateFetchController(dataService: dataService)
Task.detached(priority: .background) {
await self.loadSearchQuery(dataService: dataService, isRefresh: isRefresh)
}
}
isLoading = false

View file

@ -22,7 +22,7 @@ public struct CommunityModal: View {
things you can do to help us build a better Omnivore.
If you would like to financially assist Omnivore \
please [Contribute on Open Collective](https://opencollective.com/omnivore).
please [contribute on Open Collective](https://opencollective.com/omnivore).
"""
public init() {}