drop after gap items when > optimal size

This commit is contained in:
Diogo
2024-11-07 23:21:05 +00:00
parent a8e2fd3c97
commit 9974460dcf
@@ -925,6 +925,9 @@ struct ChatView: View {
let size = max(0, (apiGap ?? 0) - index - reversedPage.count)
if size > 0 {
im.gap = ChatGap(index: gap.index, size: size)
if im.reversedChatItems.count + dedupedreversePage.count - gap.index > idealChatListSize {
im.reversedChatItems.removeLast(dedupedreversePage.count)
}
} else {
im.gap = nil
}