ssb: Better handling of private message drafts.

This commit is contained in:
2025-08-13 19:53:28 -04:00
parent 7cec0f7d61
commit f378db6c6f
4 changed files with 16 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ class TfComposeElement extends LitElement {
author: {type: String},
channel: {type: String},
new_thread: {type: Boolean},
recipients: {type: Array},
};
}
@@ -496,7 +497,17 @@ class TfComposeElement extends LitElement {
}
get_draft() {
return this.drafts[this.branch || ''] || {};
let key =
this.branch ||
(this.recipients ? this.recipients.join(',') : undefined) ||
'';
let draft = this.drafts[key] || {};
if (this.recipients && !draft.encrypt_to?.length) {
draft.encrypt_to = [
...new Set(this.recipients).union(new Set(draft.encrypt_to ?? [])),
];
}
return draft;
}
update_encrypt(event) {