From 66f36ce71b467cfd1c1911af1acfa8e58497c1aa Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 24 Apr 2024 04:07:45 +0200 Subject: [PATCH] fix(web): show stray objects too --- web/src/components/timeline.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs index 6002f1ec..20161430 100644 --- a/web/src/components/timeline.rs +++ b/web/src/components/timeline.rs @@ -138,8 +138,14 @@ pub fn TimelineFeed(tl: Timeline) -> impl IntoView { key=|k| k.to_string() children=move |id: String| { match CACHE.get(&id) { - Some(item) => match item.base_type() { - Some(apb::BaseType::Object(apb::ObjectType::Activity(_))) => { + Some(item) => match item.object_type() { + // special case for placeholder activities + Some(apb::ObjectType::Note) => view! { + +
+ }.into_view(), + // everything else + Some(apb::ObjectType::Activity(_)) => { let object_id = item.object().id().unwrap_or_default(); let object = CACHE.get(&object_id).map(|obj| { view! { } @@ -150,10 +156,7 @@ pub fn TimelineFeed(tl: Timeline) -> impl IntoView {
}.into_view() }, - Some(apb::BaseType::Object(apb::ObjectType::Note)) => view! { - -
- }.into_view(), + // should never happen _ => view! {

type not implemented


}.into_view(), }, None => view! { @@ -215,6 +218,8 @@ async fn process_activities( activity_id.to_string(), activity.clone().set_object(apb::Node::maybe_link(object_id)) ); + } else if let Some(object_id) = activity.object().id() { + out.push(object_id); } if let Some(uid) = activity.attributed_to().id() {