Skip to content

Commit

Permalink
fix(ImageCache): null paintables
Browse files Browse the repository at this point in the history
after the performance improvements, it became *much* faster, causing the paintable to be done before the initial !is_loaded callback which 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
  • Loading branch information
GeopJr committed May 9, 2023
1 parent 1d1f67b commit 58086b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Services/Cache/ImageCache.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -56,8 +57,6 @@ public class Tuba.ImageCache : AbstractCache {
cb (true, null);
});

cb (false, null);

items_in_progress.@set (key, download_msg);
}
else {
Expand Down

0 comments on commit 58086b0

Please sign in to comment.