diff --git a/web/src/lib.rs b/web/src/lib.rs index 8ce2d30a..b00f0f7e 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -118,10 +118,12 @@ impl Uri { } pub fn short(url: &str) -> String { - if url.starts_with(URL_BASE) { + if url.starts_with(URL_BASE) || url.starts_with('/') { uriproxy::decompose_id(url) - } else { + } else if url.starts_with("https://") || url.starts_with("http") { uriproxy::compact_id(url) + } else { + url.to_string() } } diff --git a/web/src/page/user.rs b/web/src/page/user.rs index 9079dff8..2ec78bdc 100644 --- a/web/src/page/user.rs +++ b/web/src/page/user.rs @@ -28,7 +28,8 @@ pub fn UserPage(tl: Timeline) -> impl IntoView { .cloned() .unwrap_or_default(); let uid = uriproxy::uri(URL_BASE, uriproxy::UriClass::User, &id); - let actor = create_local_resource(move || params.get().get("id").cloned().unwrap_or_default(), move |id| { + let _uid = uid.clone(); + let actor = create_local_resource(move || _uid.clone(), move |id| { async move { match CACHE.get(&Uri::full(U::User, &id)) { Some(x) => Some(x.clone()),