Fix first tab ready

This commit is contained in:
Ali 2023-06-23 11:33:07 +03:00
parent fe373b505f
commit 3f46aeac43
2 changed files with 9 additions and 5 deletions

View File

@ -977,6 +977,7 @@ public final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDele
return
}
let _ = self
//let _ = self.contentScrollingEnded?(self.currentItemNode)
}
itemNode.listNode.contentScrollingEnded = { [weak self] listView in
guard let self else {
@ -1441,7 +1442,7 @@ public final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDele
self?.filterEmptyAction(filter)
}, secondaryEmptyAction: { [weak self] in
self?.secondaryEmptyAction()
}, autoSetReady: false)
}, autoSetReady: !animated)
let disposable = MetaDisposable()
self.pendingItemNode = (id, itemNode, disposable)

View File

@ -4924,10 +4924,13 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
public func scrollToOffsetFromTop(_ offset: CGFloat, animated: Bool) -> Bool {
for itemNode in self.itemNodes {
if itemNode.index == 0 {
if animated {
self.scroller.setContentOffset(CGPoint(x: 0.0, y: offset + self.tempTopInset), animated: animated)
} else {
self.scroller.contentOffset = CGPoint(x: 0.0, y: offset + self.tempTopInset)
if self.scroller.contentOffset.y != offset + self.tempTopInset {
self.stopScrolling()
if animated {
self.scroller.setContentOffset(CGPoint(x: 0.0, y: offset + self.tempTopInset), animated: animated)
} else {
self.scroller.contentOffset = CGPoint(x: 0.0, y: offset + self.tempTopInset)
}
}
return true
}