mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various fixes
This commit is contained in:
@@ -59,6 +59,7 @@ final class AvatarPreviewComponent: Component {
|
||||
private weak var state: EmptyComponentState?
|
||||
|
||||
private let stickerFetchedDisposable = MetaDisposable()
|
||||
private let cachedDisposable = MetaDisposable()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
self.imageView = UIImageView()
|
||||
@@ -84,6 +85,7 @@ final class AvatarPreviewComponent: Component {
|
||||
|
||||
deinit {
|
||||
self.stickerFetchedDisposable.dispose()
|
||||
self.cachedDisposable.dispose()
|
||||
}
|
||||
|
||||
@objc func tapped() {
|
||||
@@ -202,6 +204,9 @@ final class AvatarPreviewComponent: Component {
|
||||
let source = AnimatedStickerResourceSource(account: component.context.account, resource: file.resource, isVideo: file.isVideoSticker || file.mimeType == "video/webm")
|
||||
self.animationNode?.setup(source: source, width: Int(fittedDimensions.width), height: Int(fittedDimensions.height), playbackMode: .count(2), mode: .direct(cachePathPrefix: nil))
|
||||
self.animationNode?.visibility = true
|
||||
|
||||
self.cachedDisposable.set((source.cachedDataPath(width: 384, height: 384)
|
||||
|> deliverOn(Queue.concurrentDefaultQueue())).start())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user