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/ > <hr/ >
}.into_view(), }.into_view(),
// everything else // everything else
Some(apb::ObjectType::Activity(_)) => { Some(apb::ObjectType::Activity(t)) => {
let object_id = item.object().id().unwrap_or_default(); let object_id = item.object().id().unwrap_or_default();
let object = CACHE.get(&object_id).map(|obj| { let object = match t {
view! { <Object object=obj /> } 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! { view! {
<ActivityLine activity=item /> <ActivityLine activity=item />
{object} {object}