From ecaecd3b6542f046e22f80b13837417be4612857 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 22 Apr 2024 02:10:27 +0200 Subject: [PATCH] fix(web): show all activities in thread, alt texts --- web/src/components/object.rs | 2 +- web/src/components/timeline.rs | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/web/src/components/object.rs b/web/src/components/object.rs index c46b5a6..63c6ddf 100644 --- a/web/src/components/object.rs +++ b/web/src/components/object.rs @@ -13,7 +13,7 @@ pub fn Object(object: serde_json::Value) -> impl IntoView { let author = CACHE.get_or(&author_id, serde_json::Value::String(author_id.clone())); let attachments = object.attachment() .map(|x| view! { -

+

}) .collect_view(); view! { diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs index e2266a9..6f8e9bf 100644 --- a/web/src/components/timeline.rs +++ b/web/src/components/timeline.rs @@ -51,8 +51,8 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView { .into_iter() .filter_map(|x| CACHE.get(&x)) .filter(|x| match x.object_type() { - Some(apb::ObjectType::Activity(_)) => x.object().get().map(|o| o.in_reply_to().id().map(|r| r == root).unwrap_or(false)) - .unwrap_or_else(|| x.object().id().map(|i| i == root).unwrap_or(false)), + Some(apb::ObjectType::Activity(apb::ActivityType::Create)) => x.object().get().map(|o| o.in_reply_to().id().map(|r| r == root).unwrap_or(false)).unwrap_or(false), + Some(apb::ObjectType::Activity(_)) => x.object().id().map(|o| o == root).unwrap_or(false), _ => x.in_reply_to().id().map(|r| r == root).unwrap_or(false), }) .collect::>(); @@ -62,12 +62,19 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView { each=root_values key=|k| k.id().unwrap_or_default().to_string() children=move |object: serde_json::Value| { - let oid = object.id().unwrap_or_default().to_string(); - view! { - -
- -
+ match object.object_type() { + Some(apb::ObjectType::Activity(_)) => view! { + + }.into_view(), + _ => { + let oid = object.id().unwrap_or_default().to_string(); + view! { + +
+ +
+ }.into_view() + }, } } / >