mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various Improvements
This commit is contained in:
@@ -558,6 +558,9 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
public private(set) var loadState: ChatHistoryNodeLoadState?
|
||||
private var loadStateUpdated: ((ChatHistoryNodeLoadState, Bool) -> Void)?
|
||||
|
||||
public private(set) var hasPlentyOfMessages: Bool = false
|
||||
public var hasPlentyOfMessagesUpdated: ((Bool) -> Void)?
|
||||
|
||||
private var loadedMessagesFromCachedDataDisposable: Disposable?
|
||||
|
||||
let isTopReplyThreadMessageShown = ValuePromise<Bool>(false, ignoreRepeated: true)
|
||||
@@ -2520,6 +2523,22 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
strongSelf.loadStateUpdated?(loadState, animated || transition.animateIn || animateIn)
|
||||
}
|
||||
|
||||
var hasPlentyOfMessages = false
|
||||
if let historyView = strongSelf.historyView {
|
||||
if historyView.originalView.holeEarlier || historyView.originalView.holeLater {
|
||||
hasPlentyOfMessages = true
|
||||
} else if !historyView.originalView.holeEarlier && !historyView.originalView.holeLater {
|
||||
if historyView.filteredEntries.count >= 10 {
|
||||
hasPlentyOfMessages = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if strongSelf.hasPlentyOfMessages != hasPlentyOfMessages {
|
||||
strongSelf.hasPlentyOfMessages = hasPlentyOfMessages
|
||||
strongSelf.hasPlentyOfMessagesUpdated?(hasPlentyOfMessages)
|
||||
}
|
||||
|
||||
if let _ = visibleRange.loadedRange {
|
||||
if let visible = visibleRange.visibleRange {
|
||||
let visibleFirstIndex = visible.firstIndex
|
||||
|
||||
Reference in New Issue
Block a user