mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-02 12:48:45 +00:00
Fixed animated sticker loading in panels
This commit is contained in:
parent
e9520a2de5
commit
4bd653c0c0
@ -92,8 +92,6 @@ final class HorizontalStickerGridItemNode: GridItemNode {
|
||||
if self.currentState == nil || self.currentState!.0 !== account || self.currentState!.1.file.id != item.file.id {
|
||||
if let dimensions = item.file.dimensions {
|
||||
if item.file.isAnimatedSticker {
|
||||
self.stickerFetchedDisposable.set(nil)
|
||||
|
||||
let animationNode: AnimatedStickerNode
|
||||
if let currentAnimationNode = self.animationNode {
|
||||
animationNode = currentAnimationNode
|
||||
@ -111,7 +109,6 @@ final class HorizontalStickerGridItemNode: GridItemNode {
|
||||
} else {
|
||||
self.imageNode.alpha = 1.0
|
||||
self.imageNode.setSignal(chatMessageSticker(account: account, file: item.file, small: true))
|
||||
self.stickerFetchedDisposable.set(freeMediaFileResourceInteractiveFetched(account: account, fileReference: stickerPackFileReference(item.file), resource: chatMessageStickerResource(file: item.file, small: true)).start())
|
||||
|
||||
if let currentAnimationNode = self.animationNode {
|
||||
self.animationNode = nil
|
||||
@ -119,6 +116,8 @@ final class HorizontalStickerGridItemNode: GridItemNode {
|
||||
}
|
||||
}
|
||||
|
||||
self.stickerFetchedDisposable.set(freeMediaFileResourceInteractiveFetched(account: account, fileReference: stickerPackFileReference(item.file), resource: chatMessageStickerResource(file: item.file, small: true)).start())
|
||||
|
||||
self.currentState = (account, item, dimensions)
|
||||
self.setNeedsLayout()
|
||||
}
|
||||
|
||||
@ -209,4 +209,3 @@ public class InviteContactsController: ViewController, MFMessageComposeViewContr
|
||||
self.contactsNode.selectionState = self.contactsNode.selectionState.withClearedSelection()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -91,13 +91,15 @@ private final class TrendingTopItemNode: ASDisplayNode {
|
||||
self.addSubnode(self.imageNode)
|
||||
}
|
||||
|
||||
deinit {
|
||||
self.loadDisposable.dispose()
|
||||
}
|
||||
|
||||
func setup(account: Account, item: StickerPackItem, itemSize: CGSize, synchronousLoads: Bool) {
|
||||
self.file = item.file
|
||||
self.itemSize = itemSize
|
||||
|
||||
if item.file.isAnimatedSticker {
|
||||
self.loadDisposable.set(nil)
|
||||
|
||||
let animationNode: AnimatedStickerNode
|
||||
if let currentAnimationNode = self.animationNode {
|
||||
animationNode = currentAnimationNode
|
||||
@ -114,13 +116,13 @@ private final class TrendingTopItemNode: ASDisplayNode {
|
||||
animationNode.setup(account: account, resource: item.file.resource, width: 140, height: 140, mode: .cached)
|
||||
} else {
|
||||
self.imageNode.setSignal(chatMessageSticker(account: account, file: item.file, small: true, synchronousLoad: synchronousLoads), attemptSynchronously: synchronousLoads)
|
||||
self.loadDisposable.set(freeMediaFileResourceInteractiveFetched(account: account, fileReference: stickerPackFileReference(item.file), resource: chatMessageStickerResource(file: item.file, small: true)).start())
|
||||
|
||||
if let currentAnimationNode = self.animationNode {
|
||||
self.animationNode = nil
|
||||
currentAnimationNode.removeFromSupernode()
|
||||
}
|
||||
}
|
||||
self.loadDisposable.set(freeMediaFileResourceInteractiveFetched(account: account, fileReference: stickerPackFileReference(item.file), resource: chatMessageStickerResource(file: item.file, small: true)).start())
|
||||
}
|
||||
|
||||
func updatePreviewing(animated: Bool, isPreviewing: Bool) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user