prettier
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 33m8s

This commit is contained in:
2025-06-18 12:37:41 -04:00
parent 066827f8f1
commit b56c3efde0

View File

@ -367,9 +367,10 @@ class TfElement extends LitElement {
'"' + this.whoami.replace('"', '""') + '"',
this.whoami,
];
let channels = (await Promise.all([
this.query_timed(
`
let channels = (
await Promise.all([
this.query_timed(
`
SELECT channels.value AS channel, MAX(messages.rowid) AS rowid FROM messages
JOIN json_each(?1) AS channels ON messages.content ->> 'channel' = channels.value
JOIN json_each(?2) AS following ON messages.author = following.value
@ -379,10 +380,10 @@ class TfElement extends LitElement {
messages.author != ?4
GROUP by channel
`,
k_args
),
this.query_timed(
`
k_args
),
this.query_timed(
`
SELECT channels.value AS channel, MAX(messages.rowid) AS rowid FROM messages
JOIN messages_refs ON messages.id = messages_refs.message
JOIN json_each(?1) AS channels ON messages_refs.ref = '#' || channels.value
@ -393,10 +394,10 @@ class TfElement extends LitElement {
messages.author != ?4
GROUP by channel
`,
k_args
),
this.query_timed(
`
k_args
),
this.query_timed(
`
SELECT '' AS channel, MAX(messages.rowid) AS rowid FROM messages
JOIN json_each(?2) AS following ON messages.author = following.value
WHERE
@ -404,28 +405,29 @@ class TfElement extends LitElement {
messages.content ->> 'root' IS NULL AND
messages.author != ?4
`,
k_args
),
this.query_timed(
`
k_args
),
this.query_timed(
`
SELECT '@' AS channel, MAX(messages.rowid) AS rowid FROM messages_fts(?3)
JOIN messages ON messages.rowid = messages_fts.rowid
JOIN json_each(?2) AS following ON messages.author = following.value
WHERE messages.author != ?4
`,
k_args
),
this.query_timed(
`
k_args
),
this.query_timed(
`
SELECT '👍' AS channel, MAX(messages.rowid) AS rowid FROM messages
JOIN json_each(?2) AS following ON messages.author = following.value
WHERE
messages.content ->> 'type' = 'vote' AND
messages.author != ?4
`,
k_args
),
])).flat();
k_args
),
])
).flat();
let latest = {};
for (let row of channels) {
if (!latest[row.channel]) {