mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Reactions update
This commit is contained in:
@@ -141,11 +141,13 @@ final class MessageReactionButtonsNode: ASDisplayNode {
|
||||
},
|
||||
reactions: reactions.reactions.map { reaction in
|
||||
var centerAnimation: TelegramMediaFile?
|
||||
var legacyIcon: TelegramMediaFile?
|
||||
|
||||
if let availableReactions = availableReactions {
|
||||
for availableReaction in availableReactions.reactions {
|
||||
if availableReaction.value == reaction.value {
|
||||
centerAnimation = availableReaction.centerAnimation
|
||||
legacyIcon = availableReaction.staticIcon
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -170,7 +172,8 @@ final class MessageReactionButtonsNode: ASDisplayNode {
|
||||
return ReactionButtonsAsyncLayoutContainer.Reaction(
|
||||
reaction: ReactionButtonComponent.Reaction(
|
||||
value: reaction.value,
|
||||
centerAnimation: centerAnimation
|
||||
centerAnimation: centerAnimation,
|
||||
legacyIcon: legacyIcon
|
||||
),
|
||||
count: Int(reaction.count),
|
||||
peers: peers,
|
||||
@@ -308,12 +311,17 @@ final class MessageReactionButtonsNode: ASDisplayNode {
|
||||
|
||||
let itemValue = item.value
|
||||
let itemNode = item.node
|
||||
item.node.isGestureEnabled = canViewMessageReactionList(message: message)
|
||||
item.node.isGestureEnabled = true
|
||||
let canViewReactionList = canViewMessageReactionList(message: message)
|
||||
item.node.activateAfterCompletion = !canViewReactionList
|
||||
item.node.activated = { [weak itemNode] gesture, _ in
|
||||
guard let strongSelf = self, let itemNode = itemNode else {
|
||||
gesture.cancel()
|
||||
return
|
||||
}
|
||||
if !canViewReactionList {
|
||||
return
|
||||
}
|
||||
strongSelf.openReactionPreview?(gesture, itemNode.containerNode, itemValue)
|
||||
}
|
||||
item.node.additionalActivationProgressLayer = itemMaskView.layer
|
||||
|
||||
Reference in New Issue
Block a user