mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Merge commit '4bd653c0c0fd5c4be29dba67021342a0b863c507'
This commit is contained in:
commit
2003e723ce
@ -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 self.currentState == nil || self.currentState!.0 !== account || self.currentState!.1.file.id != item.file.id {
|
||||||
if let dimensions = item.file.dimensions {
|
if let dimensions = item.file.dimensions {
|
||||||
if item.file.isAnimatedSticker {
|
if item.file.isAnimatedSticker {
|
||||||
self.stickerFetchedDisposable.set(nil)
|
|
||||||
|
|
||||||
let animationNode: AnimatedStickerNode
|
let animationNode: AnimatedStickerNode
|
||||||
if let currentAnimationNode = self.animationNode {
|
if let currentAnimationNode = self.animationNode {
|
||||||
animationNode = currentAnimationNode
|
animationNode = currentAnimationNode
|
||||||
@ -111,7 +109,6 @@ final class HorizontalStickerGridItemNode: GridItemNode {
|
|||||||
} else {
|
} else {
|
||||||
self.imageNode.alpha = 1.0
|
self.imageNode.alpha = 1.0
|
||||||
self.imageNode.setSignal(chatMessageSticker(account: account, file: item.file, small: true))
|
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 {
|
if let currentAnimationNode = self.animationNode {
|
||||||
self.animationNode = nil
|
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.currentState = (account, item, dimensions)
|
||||||
self.setNeedsLayout()
|
self.setNeedsLayout()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -209,4 +209,3 @@ public class InviteContactsController: ViewController, MFMessageComposeViewContr
|
|||||||
self.contactsNode.selectionState = self.contactsNode.selectionState.withClearedSelection()
|
self.contactsNode.selectionState = self.contactsNode.selectionState.withClearedSelection()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -91,13 +91,15 @@ private final class TrendingTopItemNode: ASDisplayNode {
|
|||||||
self.addSubnode(self.imageNode)
|
self.addSubnode(self.imageNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
self.loadDisposable.dispose()
|
||||||
|
}
|
||||||
|
|
||||||
func setup(account: Account, item: StickerPackItem, itemSize: CGSize, synchronousLoads: Bool) {
|
func setup(account: Account, item: StickerPackItem, itemSize: CGSize, synchronousLoads: Bool) {
|
||||||
self.file = item.file
|
self.file = item.file
|
||||||
self.itemSize = itemSize
|
self.itemSize = itemSize
|
||||||
|
|
||||||
if item.file.isAnimatedSticker {
|
if item.file.isAnimatedSticker {
|
||||||
self.loadDisposable.set(nil)
|
|
||||||
|
|
||||||
let animationNode: AnimatedStickerNode
|
let animationNode: AnimatedStickerNode
|
||||||
if let currentAnimationNode = self.animationNode {
|
if let currentAnimationNode = self.animationNode {
|
||||||
animationNode = currentAnimationNode
|
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)
|
animationNode.setup(account: account, resource: item.file.resource, width: 140, height: 140, mode: .cached)
|
||||||
} else {
|
} else {
|
||||||
self.imageNode.setSignal(chatMessageSticker(account: account, file: item.file, small: true, synchronousLoad: synchronousLoads), attemptSynchronously: synchronousLoads)
|
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 {
|
if let currentAnimationNode = self.animationNode {
|
||||||
self.animationNode = nil
|
self.animationNode = nil
|
||||||
currentAnimationNode.removeFromSupernode()
|
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) {
|
func updatePreviewing(animated: Bool, isPreviewing: Bool) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user