Various improvements

This commit is contained in:
Isaac
2023-12-28 17:38:21 +04:00
parent 7c0d5519bf
commit 1d7bf5aa12
7 changed files with 65 additions and 17 deletions

View File

@@ -18986,6 +18986,17 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
public func transferScrollingVelocity(_ velocity: CGFloat) {
self.chatDisplayNode.historyNode.transferVelocity(velocity)
}
public func performScrollToTop() -> Bool {
let offset = self.chatDisplayNode.historyNode.visibleContentOffset()
switch offset {
case let .known(value) where value <= CGFloat.ulpOfOne:
return false
default:
self.chatDisplayNode.historyNode.scrollToEndOfHistory()
return true
}
}
}
final class ChatContextControllerContentSourceImpl: ContextControllerContentSource {