diff --git a/web/src/objects/context.rs b/web/src/objects/context.rs index cfecbb1..dec9a4d 100644 --- a/web/src/objects/context.rs +++ b/web/src/objects/context.rs @@ -7,16 +7,18 @@ 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() + }); 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)); + let tl_url = format!("{}/context/page", Uri::api(U::Object, &id.get(), false)); if !feeds.context.next.get_untracked().starts_with(&tl_url) { feeds.context.reset(Some(tl_url)); } }); view! {
- +
} } diff --git a/web/src/objects/replies.rs b/web/src/objects/replies.rs index 1769ade..8e4838e 100644 --- a/web/src/objects/replies.rs +++ b/web/src/objects/replies.rs @@ -7,16 +7,18 @@ use crate::prelude::*; pub fn ObjectReplies() -> 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() + ); 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)); + let tl_url = format!("{}/replies/page", Uri::api(U::Object, &id.get(), false)); if !feeds.replies.next.get_untracked().starts_with(&tl_url) { feeds.replies.reset(Some(tl_url)); } }); view! {
- +
} }