mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 05:51:42 +00:00
ListViewTransactionQueue: changed assert to precondition
ListView: fixed header view flashing
This commit is contained in:
parent
d2592223e0
commit
a1aecb45d3
@ -1142,12 +1142,13 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
}
|
||||
} else if let itemHighlightOverlayBackground = self.itemHighlightOverlayBackground {
|
||||
self.itemHighlightOverlayBackground = nil
|
||||
transition.updateAlpha(node: itemHighlightOverlayBackground, alpha: 0.0, completion: { [weak itemHighlightOverlayBackground] _ in
|
||||
itemHighlightOverlayBackground?.removeFromSupernode()
|
||||
})
|
||||
for (_, headerNode) in self.itemHeaderNodes {
|
||||
self.view.bringSubview(toFront: headerNode.view)
|
||||
}
|
||||
self.view.bringSubview(toFront: itemHighlightOverlayBackground.view)
|
||||
transition.updateAlpha(node: itemHighlightOverlayBackground, alpha: 0.0, completion: { [weak itemHighlightOverlayBackground] _ in
|
||||
itemHighlightOverlayBackground?.removeFromSupernode()
|
||||
})
|
||||
if let verticalScrollIndicator = self.verticalScrollIndicator {
|
||||
verticalScrollIndicator.view.superview?.bringSubview(toFront: verticalScrollIndicator.view)
|
||||
}
|
||||
|
||||
@ -15,13 +15,13 @@ public final class ListViewTransactionQueue {
|
||||
}
|
||||
|
||||
public func addTransaction(_ transaction: @escaping ListViewTransaction) {
|
||||
assert(Thread.isMainThread)
|
||||
precondition(Thread.isMainThread)
|
||||
let beginTransaction = self.transactions.count == 0
|
||||
self.transactions.append(transaction)
|
||||
|
||||
if beginTransaction {
|
||||
transaction({ [weak self] in
|
||||
assert(Thread.isMainThread)
|
||||
precondition(Thread.isMainThread)
|
||||
|
||||
if Thread.isMainThread {
|
||||
if let strongSelf = self {
|
||||
@ -39,7 +39,7 @@ public final class ListViewTransactionQueue {
|
||||
}
|
||||
|
||||
private func endTransaction() {
|
||||
assert(Thread.isMainThread)
|
||||
precondition(Thread.isMainThread)
|
||||
Queue.mainQueue().async {
|
||||
self.transactionCompleted()
|
||||
if !self.transactions.isEmpty {
|
||||
@ -48,7 +48,7 @@ public final class ListViewTransactionQueue {
|
||||
|
||||
if let nextTransaction = self.transactions.first {
|
||||
nextTransaction({ [weak self] in
|
||||
assert(Thread.isMainThread)
|
||||
precondition(Thread.isMainThread)
|
||||
|
||||
if Thread.isMainThread {
|
||||
if let strongSelf = self {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user