From 5c94e379370532a4faa8bffd88bb86c4d8f19db7 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 20 Nov 2024 23:18:13 +0100 Subject: [PATCH] fix(web): change tl url not root id --- web/src/objects/context.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/web/src/objects/context.rs b/web/src/objects/context.rs index 5ab4c9f..775ef0a 100644 --- a/web/src/objects/context.rs +++ b/web/src/objects/context.rs @@ -8,25 +8,26 @@ 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() + let id = Signal::derive(move || { + let id = params.get().ok() .and_then(|x| x.id) - .unwrap_or_default() - ); + .unwrap_or_default(); + Uri::full(U::Object, &id) + }); let context_id = Signal::derive(move || - cache::OBJECTS.get(&Uri::full(U::Object, &id.get())) + cache::OBJECTS.get(&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)); + let tl_url = format!("{}/context/page", Uri::api(U::Object, &context_id.get(), false)); if !feeds.context.next.get_untracked().starts_with(&tl_url) { feeds.context.reset(Some(tl_url)); } }); view! {
- +
} }