mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
load more items if threshold index is greater than the current index
This commit is contained in:
parent
e51c4ff1b1
commit
cc24f6cbe7
1 changed files with 1 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ public final class HomeFeedViewModel: ObservableObject {
|
|||
let thresholdIndex = items.index(items.endIndex, offsetBy: -5)
|
||||
|
||||
// Check if user has scrolled to the last five items in the list
|
||||
if itemIndex == thresholdIndex, items.count < thresholdIndex + 10 {
|
||||
if let itemIndex = itemIndex, itemIndex > thresholdIndex, items.count < thresholdIndex + 10 {
|
||||
performActionSubject.send(.loadItems(query: searchQuery))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue