Fix animations

This commit is contained in:
Isaac 2024-06-02 16:07:00 +04:00
parent eb77e468f4
commit 8a1d228fba
5 changed files with 19 additions and 1 deletions

View File

@ -592,7 +592,11 @@ public class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
}
}
let isPlaying = self.visibilityStatus == true && !self.forceStopAnimations
var isPlaying = self.visibilityStatus == true && !self.forceStopAnimations
if !item.controllerInteraction.canReadHistory {
isPlaying = false
}
if !isPlaying {
self.removeAdditionalAnimations()
self.removeEffectAnimations()

View File

@ -5936,6 +5936,9 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
} else {
isPlaying = false
}
if !item.controllerInteraction.canReadHistory {
isPlaying = false
}
if !isPlaying {
self.removeEffectAnimations()

View File

@ -2156,6 +2156,9 @@ public class ChatMessageStickerItemNode: ChatMessageItemView {
} else {
isPlaying = false
}
if !item.controllerInteraction.canReadHistory {
isPlaying = false
}
if !isPlaying {
self.removeEffectAnimations()

View File

@ -293,6 +293,7 @@ public final class ChatControllerInteraction: ChatControllerInteractionProtocol
public var recommendedChannelsOpenUp: Bool = false
public var enableFullTranslucency: Bool = true
public var chatIsRotated: Bool = true
public var canReadHistory: Bool = false
public init(
openMessage: @escaping (Message, OpenMessageParams) -> Bool,

View File

@ -2121,6 +2121,7 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
if let strongSelf = self {
if strongSelf.canReadHistoryValue != value {
strongSelf.canReadHistoryValue = value
strongSelf.controllerInteraction.canReadHistory = value
strongSelf.updateReadHistoryActions()
if strongSelf.canReadHistoryValue && !strongSelf.suspendReadingReactions && !strongSelf.messageIdsScheduledForMarkAsSeen.isEmpty {
@ -2189,6 +2190,12 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
self.messageIdsWithReactionsScheduledForMarkAsSeen.removeAll()
self.context.account.viewTracker.updateMarkReactionsSeenForMessageIds(messageIds: messageIds)
}
if self.canReadHistoryValue {
self.forEachVisibleMessageItemNode { itemNode in
itemNode.unreadMessageRangeUpdated()
}
}
}
func takeGenericReactionEffect() -> String? {