fix(web): oops forgot files

This commit is contained in:
əlemi 2024-11-10 21:43:11 +01:00
parent b8250eae6c
commit 129bc217b8
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,22 @@
use leptos::*;
use leptos_router::*;
use crate::prelude::*;
#[component]
pub fn ObjectContext() -> impl IntoView {
let feeds = use_context::<Feeds>().expect("missing feeds context");
let params = use_params::<IdParam>();
create_effect(move |_| {
let id = params.get().ok().and_then(|x| x.id).unwrap_or_default();
let tl_url = format!("{}/context/page", Uri::api(U::Object, &id, false));
if !feeds.context.next.get_untracked().starts_with(&tl_url) {
feeds.context.reset(Some(tl_url));
}
});
view! {
<div class="mr-1-r ml-1-r">
<Thread tl=feeds.context root=params.get().unwrap().id.unwrap() />
</div>
}
}

View file

@ -0,0 +1,22 @@
use leptos::*;
use leptos_router::*;
use crate::prelude::*;
#[component]
pub fn ObjectReplies() -> impl IntoView {
let feeds = use_context::<Feeds>().expect("missing feeds context");
let params = use_params::<IdParam>();
create_effect(move |_| {
let id = params.get().ok().and_then(|x| x.id).unwrap_or_default();
let tl_url = format!("{}/replies/page", Uri::api(U::Object, &id, false));
if !feeds.replies.next.get_untracked().starts_with(&tl_url) {
feeds.replies.reset(Some(tl_url));
}
});
view! {
<div class="mr-1-r ml-1-r">
<Thread tl=feeds.replies root=params.get().unwrap().id.unwrap() />
</div>
}
}