fix(web): kinda jank way to handle activity+object

This commit is contained in:
əlemi 2024-04-22 04:47:26 +02:00
parent 9c7f3f121a
commit 64774b976d

View file

@ -68,6 +68,22 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView {
key=|k| k.id().unwrap_or_default().to_string() key=|k| k.id().unwrap_or_default().to_string()
children=move |object: serde_json::Value| { children=move |object: serde_json::Value| {
match object.object_type() { match object.object_type() {
Some(apb::ObjectType::Activity(apb::ActivityType::Create)) => {
let oid = object.id().unwrap_or_default().to_string();
if let Some(note) = CACHE.get(&oid) {
view! {
<ActivityLine activity=object />
<Object object=note />
<div class="depth-r">
<TimelineRepliesRecursive tl=tl root=oid />
</div>
}.into_view()
} else {
view! {
<ActivityLine activity=object />
}.into_view()
}
},
Some(apb::ObjectType::Activity(_)) => view! { Some(apb::ObjectType::Activity(_)) => view! {
<ActivityLine activity=object /> <ActivityLine activity=object />
}.into_view(), }.into_view(),