Move mime type shenanigans from JS => C.

This commit is contained in:
2024-05-15 19:25:48 -04:00
parent 74bb2151c1
commit 523c9c9ad2
4 changed files with 164 additions and 166 deletions

View File

@ -22,7 +22,8 @@ class TfUserElement extends LitElement {
let image = html`<span
class="w3-theme-light w3-circle"
style="display: inline-block; width: 2em; height: 2em; text-align: center; line-height: 2em"
>?</span>`;
>?</span
>`;
let name = this.users?.[this.id]?.name;
name =
name !== undefined
@ -31,7 +32,8 @@ class TfUserElement extends LitElement {
if (this.users[this.id]) {
let image_link = this.users[this.id].image;
image_link = typeof image_link == 'string' ? image_link : image_link?.link;
image_link =
typeof image_link == 'string' ? image_link : image_link?.link;
if (image_link !== undefined) {
image = html`<img
class="w3-circle"
@ -41,8 +43,7 @@ class TfUserElement extends LitElement {
}
}
return html` <div style="display: inline-block; font-weight: bold">
${image}
${name}
${image} ${name}
</div>`;
}
}