fix(web): force replies display in thread view

This commit is contained in:
əlemi 2024-05-29 05:34:51 +02:00
parent b4bd7c845f
commit 1cc41cced3
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 3 additions and 2 deletions

View file

@ -36,6 +36,7 @@ pub fn ActivityLine(activity: crate::Object) -> impl IntoView {
pub fn Item( pub fn Item(
item: crate::Object, item: crate::Object,
#[prop(optional)] sep: bool, #[prop(optional)] sep: bool,
#[prop(optional)] replies: bool,
) -> impl IntoView { ) -> impl IntoView {
let config = use_context::<Signal<crate::Config>>().expect("missing config context"); let config = use_context::<Signal<crate::Config>>().expect("missing config context");
let id = item.id().unwrap_or_default().to_string(); let id = item.id().unwrap_or_default().to_string();
@ -55,7 +56,7 @@ pub fn Item(
Some(apb::ObjectType::Activity(t)) => (move || { Some(apb::ObjectType::Activity(t)) => (move || {
if config.get().filters.visible(apb::ObjectType::Activity(t)) { if config.get().filters.visible(apb::ObjectType::Activity(t)) {
let object_id = item.object().id().unwrap_or_default(); let object_id = item.object().id().unwrap_or_default();
if !config.get().filters.replies && CACHE.get(&object_id).map(|x| x.in_reply_to().id().is_some()).unwrap_or(false) { if !replies && !config.get().filters.replies && CACHE.get(&object_id).map(|x| x.in_reply_to().id().is_some()).unwrap_or(false) {
None None
} else { } else {
let object = match t { let object = match t {

View file

@ -103,7 +103,7 @@ pub fn TimelineRepliesRecursive(tl: Timeline, root: String) -> impl IntoView {
let oid = obj.id().unwrap_or_default().to_string(); let oid = obj.id().unwrap_or_default().to_string();
view! { view! {
<div class="context depth-r"> <div class="context depth-r">
<Item item=obj /> <Item item=obj replies=true />
<div class="depth-r"> <div class="depth-r">
<TimelineRepliesRecursive tl=tl root=oid /> <TimelineRepliesRecursive tl=tl root=oid />
</div> </div>