Compare commits

...

2 commits

Author SHA1 Message Date
thislight
f4ce206c52
TootBottomSheet: scrollIntoView exactly once
All checks were successful
/ depoly (push) Successful in 1m2s
2024-09-23 16:00:39 +08:00
thislight
fe15c4f37d
CompactToot: fix the author overflow 2024-09-23 15:54:50 +08:00
2 changed files with 6 additions and 3 deletions

View file

@ -80,11 +80,12 @@ const TootBottomSheet: Component = (props) => {
const toot = () => remoteToot() ?? getCache(acctText(), params.id); const toot = () => remoteToot() ?? getCache(acctText(), params.id);
createEffect(() => { createEffect((lastTootId?: string) => {
const tootId = toot()?.id; const tootId = toot()?.id;
if (!tootId) return; if (!tootId || lastTootId === tootId) return tootId;
const elementId = `toot-${tootId}`; const elementId = `toot-${tootId}`;
document.getElementById(elementId)?.scrollIntoView({ behavior: "smooth" }); document.getElementById(elementId)?.scrollIntoView({ behavior: "smooth" });
return tootId;
}); });
const [tootContext] = createResource( const [tootContext] = createResource(
@ -109,7 +110,7 @@ const TootBottomSheet: Component = (props) => {
const name = resolveCustomEmoji(t.account.displayName, t.account.emojis); const name = resolveCustomEmoji(t.account.displayName, t.account.emojis);
return `${name}'s toot`; return `${name}'s toot`;
} }
return "A toot"; return "Someone's toot";
}; };
const actSession = () => { const actSession = () => {

View file

@ -193,6 +193,8 @@
gap: 8px; gap: 8px;
align-items: center; align-items: center;
margin-bottom: 8px; margin-bottom: 8px;
flex-flow: row wrap;
justify-content: flex-end;
>.compactAuthorUsername { >.compactAuthorUsername {
color: var(--tutu-color-secondary-text-on-surface); color: var(--tutu-color-secondary-text-on-surface);