fix before cut off when a lot of items come in same page

This commit is contained in:
Diogo
2024-11-08 10:03:20 +00:00
parent 096b9f9613
commit d47898877a
+2 -1
View File
@@ -926,7 +926,8 @@ struct ChatView: View {
case .last, .initial:
im.reversedChatItems.append(contentsOf: dedupedreversePage)
case .before(_, _):
if im.reversedChatItems.count + dedupedreversePage.count > idealChatListSize {
if im.reversedChatItems.count + dedupedreversePage.count > idealChatListSize,
dedupedreversePage.count <= loadItemsPerPage {
if let gap = im.gap {
im.gap = ChatGap(index: gap.index, size: gap.size + dedupedreversePage.count)
} else {