1
0
Fork 0
forked from alemi/upub

fix(web): don't embed all activities

only create and announce, also show actor for follows
This commit is contained in:
əlemi 2024-04-24 04:50:17 +02:00
parent 2ba96e802e
commit d71510595d
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -145,11 +145,19 @@ pub fn TimelineFeed(tl: Timeline) -> impl IntoView {
<hr/ >
}.into_view(),
// everything else
Some(apb::ObjectType::Activity(_)) => {
Some(apb::ObjectType::Activity(t)) => {
let object_id = item.object().id().unwrap_or_default();
let object = CACHE.get(&object_id).map(|obj| {
view! { <Object object=obj /> }
});
let object = match t {
apb::ActivityType::Create | apb::ActivityType::Announce =>
CACHE.get(&object_id).map(|obj| {
view! { <Object object=obj /> }
}.into_view()),
apb::ActivityType::Follow =>
CACHE.get(&object_id).map(|obj| {
view! { <div class="ml-1"><ActorBanner object=obj /></div> }
}.into_view()),
_ => None,
};
view! {
<ActivityLine activity=item />
{object}