diff --git a/web/src/app.rs b/web/src/app.rs index d7ed90a1..7882d0db 100644 --- a/web/src/app.rs +++ b/web/src/app.rs @@ -34,8 +34,7 @@ pub fn App() -> impl IntoView { let (menu, set_menu) = create_signal(screen_width <= 786); let (advanced, set_advanced) = create_signal(false); - let auth_present = auth.token.get_untracked().is_some(); // skip helper to use get_untracked - let title_target = move || if auth_present { "/web/home" } else { "/web/server" }; + let title_target = move || if auth.present() { "/web/home" } else { "/web/server" }; if let Some(tok) = token.get_untracked() { spawn_local(async move { @@ -61,7 +60,7 @@ pub fn App() -> impl IntoView { server_tl.more(auth); local_tl.more(auth); - if auth_present { home_tl.more(auth) }; + if auth.token.get_untracked().is_some() { home_tl.more(auth) }; }) } else { server_tl.more(auth); diff --git a/web/src/page/user.rs b/web/src/page/user.rs index 3d83df90..6bafae1a 100644 --- a/web/src/page/user.rs +++ b/web/src/page/user.rs @@ -28,20 +28,22 @@ pub fn UserPage(tl: Timeline) -> impl IntoView { .cloned() .unwrap_or_default(); let uid = uriproxy::uri(URL_BASE, uriproxy::UriClass::Actor, &id); - let _uid = uid.clone(); - let actor = create_local_resource(move || _uid.clone(), move |id| { - async move { - match CACHE.get(&Uri::full(U::Actor, &id)) { - Some(x) => Some(x.clone()), - None => { - let user : serde_json::Value = Http::fetch(&Uri::api(U::Actor, &id, true), auth).await.ok()?; - let user = Arc::new(user); - CACHE.put(Uri::full(U::Actor, &id), user.clone()); - Some(user) - }, + let actor = create_local_resource( + move || params.get().get("id").cloned().unwrap_or_default(), + move |id| { + async move { + match CACHE.get(&Uri::full(U::Actor, &id)) { + Some(x) => Some(x.clone()), + None => { + let user : serde_json::Value = Http::fetch(&Uri::api(U::Actor, &id, true), auth).await.ok()?; + let user = Arc::new(user); + CACHE.put(Uri::full(U::Actor, &id), user.clone()); + Some(user) + }, + } } } - }); + ); view! {