ssb: Fall back to hostnames for connections in the sidebar.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 30m36s

This commit is contained in:
Cory McWilliams 2025-04-12 07:05:37 -04:00
parent 1516e17f5d
commit 3f4738e593
3 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&Why7U4i/hsoURJkoHSBkayV4MLSYJR+s9W+Z2/zHaYc=.sha256" "previous": "&XHioN0J0rvGR7c0jWUfyH3U49Elj+p8R2r/dRn4iAoM=.sha256"
} }

View File

@ -232,6 +232,7 @@ class TfTabNewsElement extends LitElement {
class="w3-bar-item" class="w3-bar-item"
style="max-width: 100%" style="max-width: 100%"
id=${x.id} id=${x.id}
fallback_name=${x.host}
.users=${this.users} .users=${this.users}
></tf-user> ></tf-user>
` `

View File

@ -6,6 +6,7 @@ class TfUserElement extends LitElement {
static get properties() { static get properties() {
return { return {
id: {type: String}, id: {type: String},
fallback_name: {type: String},
users: {type: Object}, users: {type: Object},
}; };
} }
@ -15,6 +16,7 @@ class TfUserElement extends LitElement {
constructor() { constructor() {
super(); super();
this.id = null; this.id = null;
this.fallback_name = null;
this.users = {}; this.users = {};
} }
@ -31,7 +33,7 @@ class TfUserElement extends LitElement {
>`; >`;
let name = this.users?.[this.id]?.name; let name = this.users?.[this.id]?.name;
name = html`<a target="_top" href=${'#' + this.id} name = html`<a target="_top" href=${'#' + this.id}
>${name !== undefined ? name : this.id}</a >${name ?? this.fallback_name ?? this.id}</a
>`; >`;
if (user) { if (user) {