commit ee6c080af8ab504f9862a5d278e89bcae6309bec
parent a18ba861579946ce296917e0f32bd978e02f0afc
Author: William Casarin <jb55@jb55.com>
Date: Tue, 2 May 2023 06:44:06 -0700
Fix blurhash appearing behind loaded images when swiping on carousel
Changelog-Fixed: Fixed blurhash appearing behind loaded images when swiping on carousel
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/damus/Components/ImageCarousel.swift b/damus/Components/ImageCarousel.swift
@@ -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 {
diff --git a/damus/Util/EventCache.swift b/damus/Util/EventCache.swift
@@ -25,6 +25,7 @@ enum ImageMetaProcessState {
case processing
case failed
case processed(UIImage)
+ case not_needed
var img: UIImage? {
switch self {