fix(web): use external url of objects if provided

This commit is contained in:
əlemi 2024-05-13 01:21:47 +02:00
parent 8f91b91ebe
commit 13b882d141
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -90,6 +90,7 @@ pub fn Object(object: crate::Object) -> impl IntoView {
let sensitive = object.sensitive().unwrap_or_default();
let addressed = object.addressed();
let public = addressed.iter().any(|x| x.as_str() == apb::target::PUBLIC);
let external_url = object.url().id().unwrap_or_else(|| oid.clone());
let attachments = object.attachment()
.map(|x| view! { <Attachment object=x sensitive=sensitive /> })
.collect_view();
@ -143,7 +144,7 @@ pub fn Object(object: crate::Object) -> impl IntoView {
<a class="clean hover ml-s" href={Uri::web(FetchKind::Object, object.id().unwrap_or_default())}>
<DateTime t=object.published() />
</a>
<sup><small><a class="clean ml-s" href={oid.clone()} target="_blank">""</a></small></sup>
<sup><small><a class="clean ml-s" href={external_url} target="_blank">""</a></small></sup>
</td>
</tr>
</table>