From 1741837bd06539b76f7683e724f89b62593de1e6 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 23 Apr 2024 17:35:03 +0200 Subject: [PATCH] fix(web): prefetch also users from attributed_to --- web/src/components/timeline.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs index bc20b371..7f0724e3 100644 --- a/web/src/components/timeline.rs +++ b/web/src/components/timeline.rs @@ -211,6 +211,13 @@ async fn process_activities( activity.clone().set_object(apb::Node::maybe_link(object_id)) ); } + + if let Some(uid) = activity.attributed_to().id() { + if CACHE.get(&uid).is_none() && !gonna_fetch.contains(&uid) { + gonna_fetch.insert(uid.clone()); + sub_tasks.push(Box::pin(fetch_and_update(FetchKind::User, uid, auth))); + } + } if let Some(uid) = activity.actor().id() { if CACHE.get(&uid).is_none() && !gonna_fetch.contains(&uid) {