fix(Lists): don't show spinner if there's no results

This commit is contained in:
Evangelos Paterakis 2023-02-27 23:59:27 +02:00
parent 8c908a05a7
commit b7155df0ce
No known key found for this signature in database
GPG key ID: FE5185F095BFC8C9
2 changed files with 17 additions and 14 deletions

View file

@ -279,7 +279,7 @@ public class Tooth.Views.Lists : Views.Timeline {
public Lists () {
Object (
url: @"/api/v1/lists",
url: @"/api/v1/lists",
label: _("Lists"),
icon: "tooth-list-compact-symbolic"
);
@ -343,6 +343,7 @@ public class Tooth.Views.Lists : Views.Timeline {
}
public override void on_request_finish () {
base.on_request_finish ();
on_content_changed ();
}

View file

@ -80,23 +80,25 @@ public class Tooth.Views.Timeline : AccountHolder, Streamable, Views.ContentBase
return req;
}
public virtual void on_request_finish () {}
public virtual void on_request_finish () {
status_loading = false;
}
public virtual bool request () {
var req = append_params (new Request.GET (get_req_url ()))
.with_account (account)
.with_ctx (this)
.then ((sess, msg) => {
Network.parse_array (msg, node => {
var e = entity_cache.lookup_or_insert (node, accepts);
model.append (e); //FIXME: use splice();
});
.with_account (account)
.with_ctx (this)
.then ((sess, msg) => {
Network.parse_array (msg, node => {
var e = entity_cache.lookup_or_insert (node, accepts);
model.append (e); //FIXME: use splice();
});
get_pages (msg.response_headers.get_one ("Link"));
on_content_changed ();
on_request_finish ();
})
.on_error (on_error);
get_pages (msg.response_headers.get_one ("Link"));
on_content_changed ();
on_request_finish ();
})
.on_error (on_error);
req.exec ();
return GLib.Source.REMOVE;