Fix blurhash appearing behind loaded images when swiping on carousel

Changelog-Fixed: Fixed blurhash appearing behind loaded images when swiping on carousel
This commit is contained in:
William Casarin
2023-05-02 06:44:06 -07:00
parent a18ba86157
commit ee6c080af8
2 changed files with 5 additions and 0 deletions

View File

@@ -131,6 +131,10 @@ struct ImageCarousel: View {
}
.imageFill(for: geo.size, max: maxHeight, fill: fillHeight) { fill in
state.previews.cache_image_meta(evid: evid, image_fill: fill)
// blur hash can be discarded when we have the url
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
state.events.lookup_img_metadata(url: url)?.state = .not_needed
}
image_fill = fill
}
.background {

View File

@@ -25,6 +25,7 @@ enum ImageMetaProcessState {
case processing
case failed
case processed(UIImage)
case not_needed
var img: UIImage? {
switch self {