diff --git a/web/src/components/object.rs b/web/src/components/object.rs index 9dc42a7c..9afaab72 100644 --- a/web/src/components/object.rs +++ b/web/src/components/object.rs @@ -80,7 +80,7 @@ pub fn Attachment( view! {
}.into_view(), @@ -136,7 +136,7 @@ pub fn Object(object: crate::Object) -> impl IntoView { >&
- {Uri::pretty(&x)}
+ {Uri::pretty(&x, 30)}
diff --git a/web/src/components/user.rs b/web/src/components/user.rs
index 954c9b8e..d99bee79 100644
--- a/web/src/components/user.rs
+++ b/web/src/components/user.rs
@@ -20,7 +20,7 @@ pub fn ActorStrip(object: crate::Object) -> impl IntoView {
pub fn ActorBanner(object: crate::Object) -> impl IntoView {
match object.as_ref() {
serde_json::Value::String(id) => view! {
-
+
},
serde_json::Value::Object(_) => {
let uid = object.id().unwrap_or_default().to_string();
diff --git a/web/src/lib.rs b/web/src/lib.rs
index dd5e5ed1..af53682c 100644
--- a/web/src/lib.rs
+++ b/web/src/lib.rs
@@ -204,12 +204,12 @@ impl Uri {
uriproxy::uri(URL_BASE, kind, id)
}
- pub fn pretty(url: &str) -> String {
+ pub fn pretty(url: &str, len: usize) -> String {
let bare = url.replace("https://", "");
- if bare.len() < 50 {
+ if bare.len() < len {
bare
} else {
- format!("{}..", bare.get(..50).unwrap_or_default())
+ format!("{}..", bare.get(..len).unwrap_or_default())
}.replace('/', "\u{200B}/\u{200B}")
}