fix(web): thread view shows all types of objects
This commit is contained in:
parent
dfec715594
commit
4997be5a72
1 changed files with 9 additions and 3 deletions
|
@ -50,18 +50,24 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView {
|
||||||
.get()
|
.get()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|x| CACHE.get(&x))
|
.filter_map(|x| CACHE.get(&x))
|
||||||
.filter(|x| x.object().get().map(|o| o.in_reply_to().id().map(|r| r == root).unwrap_or(false)).unwrap_or(false))
|
.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)),
|
||||||
|
_ => x.in_reply_to().id().map(|r| r == root).unwrap_or(false),
|
||||||
|
})
|
||||||
.collect::<Vec<serde_json::Value>>();
|
.collect::<Vec<serde_json::Value>>();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<For
|
<For
|
||||||
each=move || root_values()
|
each=root_values
|
||||||
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| {
|
||||||
let oid = object.id().unwrap_or_default().to_string();
|
let oid = object.id().unwrap_or_default().to_string();
|
||||||
view! {
|
view! {
|
||||||
<Object object=object />
|
<Object object=object />
|
||||||
<TimelineRepliesRecursive tl=tl root=oid />
|
<div class="ml-1">
|
||||||
|
<TimelineRepliesRecursive tl=tl root=oid />
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/ >
|
/ >
|
||||||
|
|
Loading…
Reference in a new issue