From 9952dfd49d473543cba93ffa236bab60b8f6343f Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 19 Aug 2025 12:54:19 -0400 Subject: [PATCH] ssb: Fix @-completion. --- apps/ssb.json | 2 +- apps/ssb/tf-compose.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 1acdb485..cae3675d 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&kkfTptI7rzqHIPlOR9UkiekpZuyMtR/4W8KVQ8jeOVw=.sha256" + "previous": "&TAWjrbigDwIVPfpx1I/MAUBMO+szgKW8TX7orlyCA0g=.sha256" } diff --git a/apps/ssb/tf-compose.js b/apps/ssb/tf-compose.js index c55247dd..2beeb7e3 100644 --- a/apps/ssb/tf-compose.js +++ b/apps/ssb/tf-compose.js @@ -294,7 +294,7 @@ class TfComposeElement extends LitElement { } } - firstUpdated() { + get_values() { let values = Object.entries(this.users).map((x) => ({ key: x[1].name ?? x[0], value: x[0], @@ -310,11 +310,15 @@ class TfComposeElement extends LitElement { values ); } + return values; + } + + firstUpdated() { let tribute = new Tribute({ iframe: this.shadowRoot, collection: [ { - values: values, + values: this.get_values(), selectTemplate: function (item) { return item ? `[@${item.original.key}](${item.original.value})` @@ -333,6 +337,7 @@ class TfComposeElement extends LitElement { ], }); tribute.attach(this.renderRoot.getElementById('edit')); + this._tribute = tribute; } updated() { @@ -343,6 +348,7 @@ class TfComposeElement extends LitElement { preview.innerHTML = this.process_text(edit.innerText); this.last_updated_text = edit.innerText; } + this._tribute.collection[0].values = this.get_values(); let encrypt = this.renderRoot.getElementById('encrypt_to'); if (encrypt) { let tribute = new Tribute({