ssb: prettier.

This commit is contained in:
2024-12-24 14:22:24 -05:00
parent 58e9646fa6
commit d4b421421d
3 changed files with 36 additions and 24 deletions

View File

@ -202,18 +202,20 @@ class TfComposeElement extends LitElement {
channel: this.channel,
};
if (this.root || this.branch) {
message.root = this.new_thread ? this.branch ?? this.root : this.root;
message.root = this.new_thread ? (this.branch ?? this.root) : this.root;
message.branch = this.branch;
}
let reply = Object.fromEntries((await tfrpc.rpc.query(
`
let reply = Object.fromEntries(
(
await tfrpc.rpc.query(
`
SELECT messages.id, messages.author FROM messages
JOIN json_each(?) AS refs ON messages.id = refs.value
`,
[JSON.stringify([this.root, this.branch])])).map(row => [
row.id,
row.author,
]));
[JSON.stringify([this.root, this.branch])]
)
).map((row) => [row.id, row.author])
);
if (Object.keys(reply).length) {
message.reply = reply;
}
@ -485,9 +487,13 @@ class TfComposeElement extends LitElement {
render_new_thread() {
let self = this;
if (this.root !== undefined && this.branch !== undefined && this.root != this.branch) {
if (
this.root !== undefined &&
this.branch !== undefined &&
this.root != this.branch
) {
return html`
<input type="checkbox" class="w3-check w3-theme-d1" id="new_thread" @change=${() => self.new_thread = !self.new_thread} ?checked=${self.new_thread}></input>
<input type="checkbox" class="w3-check w3-theme-d1" id="new_thread" @change=${() => (self.new_thread = !self.new_thread)} ?checked=${self.new_thread}></input>
<label for="new_thread">New Thread</label>
`;
}
@ -586,8 +592,7 @@ class TfComposeElement extends LitElement {
${Object.values(draft.mentions || {}).map((x) =>
self.render_mention(x)
)}
${this.render_attach_app()}
${this.render_content_warning()}
${this.render_attach_app()} ${this.render_content_warning()}
${this.render_new_thread()}
<button class="w3-button w3-theme-d1" id="submit" @click=${this.submit}>
Submit