From 80940b188014898a336c883dc987a94068b50efa Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 10 Nov 2024 22:06:13 +0100 Subject: [PATCH] feat(web): explicit button to fetch replies --- web/src/objects/view.rs | 13 +++++++++++++ web/src/timeline/mod.rs | 3 --- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/web/src/objects/view.rs b/web/src/objects/view.rs index b9db42f..d1dfb59 100644 --- a/web/src/objects/view.rs +++ b/web/src/objects/view.rs @@ -41,9 +41,22 @@ pub fn ObjectView() -> impl IntoView {
"🕸️"" "context" | ""📫"" "replies + {if auth.present() { + Some(view! { + " | ""↺" + }) + } else { None }} }.into_view() }, }} } + +fn crawl(base: String, auth: Auth) { + spawn_local(async move { + if let Err(e) = Http::fetch::(&format!("{base}/replies?fetch=true"), auth).await { + tracing::error!("failed crawling replies for {base}: {e}"); + } + }); +} diff --git a/web/src/timeline/mod.rs b/web/src/timeline/mod.rs index 1d66bfc..539a20e 100644 --- a/web/src/timeline/mod.rs +++ b/web/src/timeline/mod.rs @@ -84,9 +84,6 @@ impl Timeline { feed_url + "?replies=false" }; } - if auth.present() { - feed_url += "&fetch=true"; - } let collection : serde_json::Value = Http::fetch(&feed_url, auth).await?; let activities : Vec = collection .ordered_items()