From 3946999ec183cb9a79eaa6238afc5c238d58018e Mon Sep 17 00:00:00 2001 From: Evangelos Paterakis Date: Tue, 9 May 2023 23:07:27 +0300 Subject: [PATCH] fix(ImageCache): null paintables after the performance improvements, it became *much* faster, causing the paintable to be done before the initial !is_loaded callback resulting to images staying blank this commit calls it before downloading the image; another approach would be to only set paintables when is_loaded is true on all callbacks --- src/Services/Cache/ImageCache.vala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Services/Cache/ImageCache.vala b/src/Services/Cache/ImageCache.vala index 92da4cb7..01f5996b 100644 --- a/src/Services/Cache/ImageCache.vala +++ b/src/Services/Cache/ImageCache.vala @@ -29,6 +29,7 @@ public class Tuba.ImageCache : AbstractCache { var download_msg = items_in_progress.@get (key); if (download_msg == null) { // This image isn't cached, so we need to download it first. + cb (false, null); download_msg = new Soup.Message ("GET", url); network.queue (download_msg, null, (sess, mess, t_in_stream) => { @@ -56,8 +57,6 @@ public class Tuba.ImageCache : AbstractCache { cb (true, null); }); - cb (false, null); - items_in_progress.@set (key, download_msg); } else {