forked from cory/tildefriends
Show missing profile images more deliberately.
This commit is contained in:
parent
93ce253d1e
commit
abffac3f82
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"type": "tildefriends-app",
|
"type": "tildefriends-app",
|
||||||
"emoji": "🐌",
|
"emoji": "🐌",
|
||||||
"previous": "&6dwXL1RKL8t/RSV0UHBflkMnM8f8SV9VFvBZFqhW6LI=.sha256"
|
"previous": "&wA6sLaDxtYeFdVCCu8jyhPsGYtGZEjbWQHeGOn0Yifg=.sha256"
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,10 @@ class TfUserElement extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
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>`;
|
||||||
let name = this.users?.[this.id]?.name;
|
let name = this.users?.[this.id]?.name;
|
||||||
name =
|
name =
|
||||||
name !== undefined
|
name !== undefined
|
||||||
@ -26,22 +30,21 @@ class TfUserElement extends LitElement {
|
|||||||
: html`<a target="_top" href=${'#' + this.id}>${this.id}</a>`;
|
: html`<a target="_top" href=${'#' + this.id}>${this.id}</a>`;
|
||||||
|
|
||||||
if (this.users[this.id]) {
|
if (this.users[this.id]) {
|
||||||
let image = this.users[this.id].image;
|
let image_link = this.users[this.id].image;
|
||||||
image = typeof image == 'string' ? image : image?.link;
|
image_link = typeof image_link == 'string' ? image_link : image_link?.link;
|
||||||
return html` <div style="display: inline-block; font-weight: bold">
|
if (image_link !== undefined) {
|
||||||
<img
|
image = html`<img
|
||||||
style="width: 2em; height: 2em; vertical-align: middle; border-radius: 50%"
|
class="w3-circle"
|
||||||
?hidden=${image === undefined}
|
style="width: 2em; height: 2em; vertical-align: middle"
|
||||||
src="${image ? '/' + image + '/view' : undefined}"
|
src="/${image_link}/view"
|
||||||
/>
|
/>`;
|
||||||
${name}
|
|
||||||
</div>`;
|
|
||||||
} else {
|
|
||||||
return html` <div style="display: inline-block; font-weight: bold">
|
|
||||||
${name}
|
|
||||||
</div>`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return html` <div style="display: inline-block; font-weight: bold">
|
||||||
|
${image}
|
||||||
|
${name}
|
||||||
|
</div>`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define('tf-user', TfUserElement);
|
customElements.define('tf-user', TfUserElement);
|
||||||
|
Loading…
Reference in New Issue
Block a user