mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-30 09:21:28 +00:00
Fix add gifts load more
This commit is contained in:
parent
b9a2af1e97
commit
55e96a5a30
@ -101,10 +101,10 @@ final class AddGiftsScreenComponent: Component {
|
||||
}
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
self.updateScrolling(transition: .immediate)
|
||||
self.updateScrolling(interactive: true, transition: .immediate)
|
||||
}
|
||||
|
||||
private func updateScrolling(transition: ComponentTransition) {
|
||||
private func updateScrolling(interactive: Bool = false, transition: ComponentTransition) {
|
||||
guard let environment = self.environment, let giftsListView = self.giftsListView else {
|
||||
return
|
||||
}
|
||||
@ -120,6 +120,11 @@ final class AddGiftsScreenComponent: Component {
|
||||
if self.scrollView.contentSize != contentSize {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
|
||||
let bottomContentOffset = max(0.0, self.scrollNode.view.contentSize.height - self.scrollNode.view.contentOffset.y - self.scrollNode.view.frame.height)
|
||||
if interactive, bottomContentOffset < 200.0 {
|
||||
self.giftsListView.loadMore()
|
||||
}
|
||||
}
|
||||
|
||||
func update(component: AddGiftsScreenComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<EnvironmentType>, transition: ComponentTransition) -> CGSize {
|
||||
|
Loading…
x
Reference in New Issue
Block a user