mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fall back to using search instead of just sync API if no items found
This commit is contained in:
parent
c18cc3b343
commit
e8304f02f2
1 changed files with 7 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue