Preload profile pictures while scrolling

Changelog-Added: Preload profile pictures while scrolling
This commit is contained in:
William Casarin
2023-05-02 07:33:54 -07:00
parent 4889c0a7d9
commit b79d361016
2 changed files with 25 additions and 4 deletions

View File

@@ -132,6 +132,9 @@ 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
// NOTE: this is the wrong place for this... we need to remove
// it when the image is loaded in memory. This may happen
// earlier than this (by the preloader, etc)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
state.events.lookup_img_metadata(url: url)?.state = .not_needed
}