Reduce messages view limit

This commit is contained in:
Peter 2019-05-18 15:54:50 +02:00
parent 775e2cb852
commit 42d6ad46d4
2 changed files with 3 additions and 3 deletions

View File

@ -326,10 +326,10 @@ public final class ChatHistoryGridNode: GridNode, ChatHistoryNode {
if let strongSelf = self, let historyView = strongSelf.historyView, let top = visibleItems.top, let bottom = visibleItems.bottom, let visibleTop = visibleItems.topVisible, let visibleBottom = visibleItems.bottomVisible {
if top.0 < 5 && historyView.originalView.laterId != nil {
let lastEntry = historyView.filteredEntries[historyView.filteredEntries.count - 1 - visibleTop.0]
strongSelf._chatHistoryLocation.set(ChatHistoryLocation.Navigation(index: .message(lastEntry.index), anchorIndex: .message(lastEntry.index), count: 200))
strongSelf._chatHistoryLocation.set(ChatHistoryLocation.Navigation(index: .message(lastEntry.index), anchorIndex: .message(lastEntry.index), count: 100))
} else if bottom.0 >= historyView.filteredEntries.count - 5 && historyView.originalView.earlierId != nil {
let firstEntry = historyView.filteredEntries[historyView.filteredEntries.count - 1 - visibleBottom.0]
strongSelf._chatHistoryLocation.set(ChatHistoryLocation.Navigation(index: .message(firstEntry.index), anchorIndex: .message(firstEntry.index), count: 200))
strongSelf._chatHistoryLocation.set(ChatHistoryLocation.Navigation(index: .message(firstEntry.index), anchorIndex: .message(firstEntry.index), count: 100))
}
}
}

View File

@ -5,7 +5,7 @@ import Display
import AsyncDisplayKit
import TelegramCore
private let historyMessageCount: Int = 200
private let historyMessageCount: Int = 100
public enum ChatHistoryListMode: Equatable {
case bubbles