Prevent votes from overflowing.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 17m23s

This commit is contained in:
Cory McWilliams 2024-09-23 12:43:48 -04:00
parent e5f58c2898
commit d104409272
2 changed files with 17 additions and 13 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🐌", "emoji": "🐌",
"previous": "&6oHPQCA26v+4nBXv+YUdCT43j2DpXDspxhHSSRydkiw=.sha256" "previous": "&7L314QLuVl8kNbFIWuXXeLqIVefUe5S66WvEmOMQb2U=.sha256"
} }

View File

@ -73,18 +73,22 @@ class TfMessageElement extends LitElement {
} }
} }
if (this.message?.votes?.length) { if (this.message?.votes?.length) {
return html`<div class="w3-button" @click=${this.show_reactions}> return html`
${(this.message.votes || []).map( <div class="w3-container">
(vote) => html` <div class="w3-button w3-bar w3-padding-small" @click=${this.show_reactions}>
<span ${(this.message.votes || []).map(
title="${this.users[vote.author]?.name ?? vote.author} ${new Date( (vote) => html`
vote.timestamp <span
)}" class="w3-bar-item w3-padding-small"
> title="${this.users[vote.author]?.name ?? vote.author} ${new Date(
${normalize_expression(vote.content.vote.expression)} vote.timestamp
</span> )}"
` >
)} ${normalize_expression(vote.content.vote.expression)}
</span>
`
)}
</div>
</div>`; </div>`;
} }
} }