diff --git a/Tusker/Views/CachedImageView.swift b/Tusker/Views/CachedImageView.swift index f72d1b7a..90a192e3 100644 --- a/Tusker/Views/CachedImageView.swift +++ b/Tusker/Views/CachedImageView.swift @@ -18,7 +18,7 @@ class CachedImageView: UIImageView { override var image: UIImage? { didSet { - fetchTask?.cancel() + blurHashTask?.cancel() } } diff --git a/Tusker/Views/Status/StatusCardView.swift b/Tusker/Views/Status/StatusCardView.swift index 61591233..bada10e3 100644 --- a/Tusker/Views/Status/StatusCardView.swift +++ b/Tusker/Views/Status/StatusCardView.swift @@ -199,38 +199,6 @@ class StatusCardView: UIView { } } - private func loadBlurHash() { - guard let card = card, let hash = card.blurhash else { return } - - AttachmentView.queue.async { [weak self] in - guard let self = self else { return } - - let size: CGSize - if let width = card.width, let height = card.height { - let aspectRatio = CGFloat(width) / CGFloat(height) - if aspectRatio > 1 { - size = CGSize(width: 32, height: 32 / aspectRatio) - } else { - size = CGSize(width: 32 * aspectRatio, height: 32) - } - } else { - size = CGSize(width: 32, height: 32) - } - - guard let preview = UIImage(blurHash: hash, size: size) else { - return - } - - DispatchQueue.main.async { [weak self] in - guard let self = self, - self.card?.url == card.url, - self.imageView.image == nil else { return } - - self.imageView.image = preview - } - } - } - override func touchesBegan(_ touches: Set, with event: UIEvent?) { hStack.backgroundColor = activeBackgroundColor setNeedsDisplay()