diff --git a/web/src/components/activity.rs b/web/src/components/activity.rs index 2a9809d2..efc0717d 100644 --- a/web/src/components/activity.rs +++ b/web/src/components/activity.rs @@ -45,39 +45,41 @@ pub fn Item( let config = use_context::>().expect("missing config context"); let id = item.id().unwrap_or_default().to_string(); let sep = if sep { Some(view! {
}) } else { None }; - if !replies && !config.get().filters.visible(&item) { - return None; - } - match item.object_type().unwrap_or(apb::ObjectType::Object) { - // special case for placeholder activities - apb::ObjectType::Note | apb::ObjectType::Document(_) => - Some(view! { {sep.clone()} }.into_view()), - // everything else - apb::ObjectType::Activity(t) => { - let object_id = item.object().id().str().unwrap_or_default(); - let object = match t { - apb::ActivityType::Create | apb::ActivityType::Announce => - CACHE.get(&object_id).map(|obj| { - view! { } - }.into_view()), - apb::ActivityType::Follow => - CACHE.get(&object_id).map(|obj| { - view! { -
- - -
- } - }.into_view()), - _ => None, - }; - Some(view! { - - {object} - {sep.clone()} - }.into_view()) - }, - // should never happen - t => Some(view! {

type not implemented : {t.as_ref().to_string()}

}.into_view()), + move || { + if !replies && !config.get().filters.visible(&item) { + return None; + } + match item.object_type().unwrap_or(apb::ObjectType::Object) { + // special case for placeholder activities + apb::ObjectType::Note | apb::ObjectType::Document(_) => + Some(view! { {sep.clone()} }.into_view()), + // everything else + apb::ObjectType::Activity(t) => { + let object_id = item.object().id().str().unwrap_or_default(); + let object = match t { + apb::ActivityType::Create | apb::ActivityType::Announce => + CACHE.get(&object_id).map(|obj| { + view! { } + }.into_view()), + apb::ActivityType::Follow => + CACHE.get(&object_id).map(|obj| { + view! { +
+ + +
+ } + }.into_view()), + _ => None, + }; + Some(view! { + + {object} + {sep.clone()} + }.into_view()) + }, + // should never happen + t => Some(view! {

type not implemented : {t.as_ref().to_string()}

}.into_view()), + } } }