fix: account username changing

This commit is contained in:
trisua 2025-05-12 21:06:22 -04:00
parent 65f59100ce
commit 08505c2403
4 changed files with 40 additions and 5 deletions

View file

@ -162,6 +162,10 @@ p {
margin-bottom: 0; margin-bottom: 0;
} }
.post_right {
max-width: calc(84% + 4px);
}
.name { .name {
max-width: 250px; max-width: 250px;
overflow: hidden; overflow: hidden;
@ -178,6 +182,10 @@ p {
.name.lg\:long { .name.lg\:long {
max-width: unset; max-width: unset;
} }
.post_right {
max-width: calc(91% + 4px);
}
} }
ul, ul,
@ -357,6 +365,7 @@ img.emoji {
height: 100dvh; height: 100dvh;
top: 0; top: 0;
left: 0; left: 0;
animation: fadein ease-in-out 1 0.1s forwards running;
} }
.lightbox_exit { .lightbox_exit {
@ -369,6 +378,7 @@ img.emoji {
box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size) box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
var(--color-shadow); var(--color-shadow);
border-radius: var(--radius); border-radius: var(--radius);
animation: popin ease-in-out 1 0.15s forwards running;
} }
/* avatar/banner */ /* avatar/banner */
@ -1096,6 +1106,26 @@ dialog::backdrop {
min-width: max-content; min-width: max-content;
} }
@keyframes fadein {
from {
opacity: 0%;
}
to {
opacity: 100%;
}
}
@keyframes static_fadeout {
from {
opacity: 100%;
}
to {
opacity: 0%;
}
}
@keyframes popin { @keyframes popin {
from { from {
opacity: 0%; opacity: 0%;

View file

@ -189,7 +189,7 @@ and show_community and community.id != config.town_square or question %}
selector_type="username") }} selector_type="username") }}
</a> </a>
<div class="flex flex-col w-full gap-1"> <div class="flex flex-col w-full gap-1 post_right">
<div class="flex flex-wrap gap-2 items-center"> <div class="flex flex-wrap gap-2 items-center">
<span class="name" <span class="name"
>{{ self::full_username(user=owner) }}</span >{{ self::full_username(user=owner) }}</span
@ -242,7 +242,7 @@ and show_community and community.id != config.town_square or question %}
{{ self::post_media(upload_ids=post.uploads) }} {% else %} {{ self::post_media(upload_ids=post.uploads) }} {% else %}
<details> <details>
<summary <summary
class="card flex gap-2 items-center tertiary red w-full" class="card flex gap-2 flex-wrap items-center tertiary red w-full"
> >
{{ icon "triangle-alert" }} {{ icon "triangle-alert" }}
<b>{{ post.context.content_warning }}</b> <b>{{ post.context.content_warning }}</b>

View file

@ -1036,7 +1036,13 @@ ${option.input_element_type === "textarea" ? `${option.value}</textarea>` : ""}
}); });
self.define("lightbox_close", () => { self.define("lightbox_close", () => {
document.getElementById("lightbox").style.animation =
"static_fadeout ease-in-out 1 0.1s forwards running";
setTimeout(() => {
document.getElementById("lightbox").removeAttribute("style");
document.getElementById("lightbox").classList.add("hidden"); document.getElementById("lightbox").classList.add("hidden");
}, 250);
}); });
})(); })();

View file

@ -422,7 +422,7 @@ impl DataManager {
let res = execute!( let res = execute!(
&conn, &conn,
"UPDATE users SET username = $1 WHERE id = $2", "UPDATE users SET username = $1 WHERE id = $2",
params![&to.as_str(), &(id as i64)] params![&to.to_lowercase(), &(id as i64)]
); );
if let Err(e) = res { if let Err(e) = res {
@ -430,7 +430,6 @@ impl DataManager {
} }
self.cache_clear_user(&user).await; self.cache_clear_user(&user).await;
Ok(()) Ok(())
} }