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

View File

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