diff --git a/submodules/Display/Source/ListView.swift b/submodules/Display/Source/ListView.swift index 04c7783c3a..ea6d8cff4c 100644 --- a/submodules/Display/Source/ListView.swift +++ b/submodules/Display/Source/ListView.swift @@ -1575,7 +1575,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture } private func async(_ f: @escaping () -> Void) { - DispatchQueue.main.async(execute: f) + DispatchQueue.global(qos: .userInteractive).async(execute: f) } private func nodeForItem(synchronous: Bool, synchronousLoads: Bool, item: ListViewItem, previousNode: QueueLocalObject?, index: Int, previousItem: ListViewItem?, nextItem: ListViewItem?, params: ListViewItemLayoutParams, updateAnimationIsAnimated: Bool, updateAnimationIsCrossfade: Bool, completion: @escaping (QueueLocalObject, ListViewItemNodeLayout, @escaping () -> (Signal?, (ListViewItemApply) -> Void)) -> Void) { diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index e1dc4b61eb..89a891fce4 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -1255,14 +1255,14 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState var hasReadReports = false if let channel = peer as? TelegramChannel { if case .group = channel.info { - if let cachedData = cachedData as? CachedChannelData, let memberCount = cachedData.participantsSummary.memberCount, memberCount <= 50 { + if canViewStats { hasReadReports = true } } else { reactionCount = 0 } - } else if let group = peer as? TelegramGroup { - if group.participantCount <= 50 { + } else if let _ = peer as? TelegramGroup { + if canViewStats { hasReadReports = true } } else { diff --git a/submodules/TelegramUI/Sources/ChatMessageReactionsFooterContentNode.swift b/submodules/TelegramUI/Sources/ChatMessageReactionsFooterContentNode.swift index c26597b4e8..7caa0cffc9 100644 --- a/submodules/TelegramUI/Sources/ChatMessageReactionsFooterContentNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageReactionsFooterContentNode.swift @@ -59,7 +59,7 @@ final class MessageReactionButtonsNode: ASDisplayNode { private var bubbleBackgroundNode: WallpaperBubbleBackgroundNode? private let container: ReactionButtonsAsyncLayoutContainer - private let backgroundMaskView: UIView + private var backgroundMaskView: UIView? private var backgroundMaskButtons: [String: UIView] = [:] var reactionSelected: ((String) -> Void)? @@ -67,7 +67,6 @@ final class MessageReactionButtonsNode: ASDisplayNode { override init() { self.container = ReactionButtonsAsyncLayoutContainer() - self.backgroundMaskView = UIView() super.init() } @@ -219,6 +218,10 @@ final class MessageReactionButtonsNode: ASDisplayNode { return } + if strongSelf.backgroundMaskView == nil { + strongSelf.backgroundMaskView = UIView() + } + let backgroundInsets: CGFloat = 10.0 switch type { @@ -330,7 +333,7 @@ final class MessageReactionButtonsNode: ASDisplayNode { } if itemMaskView.superview == nil { - strongSelf.backgroundMaskView.addSubview(itemMaskView) + strongSelf.backgroundMaskView?.addSubview(itemMaskView) if animation.isAnimated { itemMaskView.layer.animateScale(from: 0.01, to: 1.0, duration: 0.4, timingFunction: kCAMediaTimingFunctionSpring) itemMaskView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)