Guard against race condition when loading card image
This commit is contained in:
parent
16cd045588
commit
24b3fa1e3f
|
@ -152,6 +152,7 @@ class StatusCardView: UIView {
|
||||||
|
|
||||||
imageRequest = ImageCache.attachments.get(URL(imageURL)!, completion: { (_, image) in
|
imageRequest = ImageCache.attachments.get(URL(imageURL)!, completion: { (_, image) in
|
||||||
guard let image = image,
|
guard let image = image,
|
||||||
|
self.card?.image == imageURL,
|
||||||
let transformedImage = ImageGrayscalifier.convertIfNecessary(url: URL(imageURL)!, image: image) else {
|
let transformedImage = ImageGrayscalifier.convertIfNecessary(url: URL(imageURL)!, image: image) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue