diff --git a/web/src/objects/context.rs b/web/src/objects/context.rs index dec9a4d..5ab4c9f 100644 --- a/web/src/objects/context.rs +++ b/web/src/objects/context.rs @@ -1,3 +1,4 @@ +use apb::Object; use leptos::*; use leptos_router::*; use crate::prelude::*; @@ -7,9 +8,16 @@ use crate::prelude::*; pub fn ObjectContext() -> impl IntoView { let feeds = use_context::().expect("missing feeds context"); let params = use_params::(); - let id = Signal::derive(move || { - params.get().ok().and_then(|x| x.id).unwrap_or_default() - }); + let id = Signal::derive(move || + params.get().ok() + .and_then(|x| x.id) + .unwrap_or_default() + ); + let context_id = Signal::derive(move || + cache::OBJECTS.get(&Uri::full(U::Object, &id.get())) + .and_then(|x| x.context().id().ok()) + .unwrap_or_default() + ); create_effect(move |_| { let tl_url = format!("{}/context/page", Uri::api(U::Object, &id.get(), false)); if !feeds.context.next.get_untracked().starts_with(&tl_url) { @@ -18,7 +26,7 @@ pub fn ObjectContext() -> impl IntoView { }); view! {
- +
} }