ssb: Split recent votes into their own sidebar item as an experiment. #122

This commit is contained in:
2025-06-04 18:00:46 -04:00
parent 7882fcbe8f
commit 45231d703d
4 changed files with 36 additions and 2 deletions

View File

@ -128,7 +128,7 @@ class TfElement extends LitElement {
}
next_channel(delta) {
let channel_names = ['', '@', '🔐', ...this.channels.map((x) => '#' + x)];
let channel_names = ['', '@', '🔐', '👍', ...this.channels.map((x) => '#' + x)];
let index = channel_names.indexOf(this.hash.substring(1));
index = index != -1 ? index + delta : 0;
tfrpc.rpc.setHash(
@ -383,6 +383,12 @@ class TfElement extends LitElement {
JOIN messages ON messages.rowid = messages_fts.rowid
JOIN json_each(?2) AS following ON messages.author = following.value
WHERE messages.author != ?4
UNION
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
`,
[
JSON.stringify(this.channels),