forked from alemi/upub
fix(web): show all activities in thread, alt texts
This commit is contained in:
parent
b6f10e9cc1
commit
ecaecd3b65
2 changed files with 16 additions and 9 deletions
|
@ -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 author = CACHE.get_or(&author_id, serde_json::Value::String(author_id.clone()));
|
||||||
let attachments = object.attachment()
|
let attachments = object.attachment()
|
||||||
.map(|x| view! {
|
.map(|x| view! {
|
||||||
<p><img class="attachment" src={x.url().id().unwrap_or_default()} /></p>
|
<p class="center"><img class="attachment" src={x.url().id().unwrap_or_default()} title={x.name().unwrap_or_default().to_string()} /></p>
|
||||||
})
|
})
|
||||||
.collect_view();
|
.collect_view();
|
||||||
view! {
|
view! {
|
||||||
|
|
|
@ -51,8 +51,8 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|x| CACHE.get(&x))
|
.filter_map(|x| CACHE.get(&x))
|
||||||
.filter(|x| match x.object_type() {
|
.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))
|
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),
|
||||||
.unwrap_or_else(|| x.object().id().map(|i| i == root).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),
|
_ => x.in_reply_to().id().map(|r| r == root).unwrap_or(false),
|
||||||
})
|
})
|
||||||
.collect::<Vec<serde_json::Value>>();
|
.collect::<Vec<serde_json::Value>>();
|
||||||
|
@ -62,12 +62,19 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView {
|
||||||
each=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| {
|
||||||
|
match object.object_type() {
|
||||||
|
Some(apb::ObjectType::Activity(_)) => view! {
|
||||||
|
<ActivityLine activity=object />
|
||||||
|
}.into_view(),
|
||||||
|
_ => {
|
||||||
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 />
|
||||||
<div class="ml-1">
|
<div class="ml-1">
|
||||||
<TimelineRepliesRecursive tl=tl root=oid />
|
<TimelineRepliesRecursive tl=tl root=oid />
|
||||||
</div>
|
</div>
|
||||||
|
}.into_view()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/ >
|
/ >
|
||||||
|
|
Loading…
Reference in a new issue