ssb: New theme, better load, remove debug prints.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 15m11s

This commit is contained in:
2024-12-01 16:27:59 -05:00
parent d84d0bec38
commit 6fe6fc180d
4 changed files with 25 additions and 28 deletions

View File

@ -254,9 +254,9 @@ class TfElement extends LitElement {
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' = 'post'
`, [JSON.stringify(this.channels), JSON.stringify(Object.keys(following))]);
this.channels_unread = JSON.parse((await tfrpc.rpc.databaseGet('unread')) ?? '{}');
console.log(by_count.sort((x, y) => y.count - x.count).slice(0, 20));
let start_time = new Date();
users = await this.fetch_about(Object.keys(following).sort(), users);
console.log(
@ -266,9 +266,10 @@ class TfElement extends LitElement {
Object.keys(users).length,
'users'
);
start_time = new Date();
channels = await channels;
console.log('channels took', (new Date() - start_time) / 1000.0);
this.channels_latest = Object.fromEntries(channels.map(x => [x.channel, x.rowid]));
console.log('CHANNELS', channels);
this.following = Object.keys(following);
this.users = users;
console.log(`load finished ${whoami} => ${this.whoami}`);
@ -277,10 +278,8 @@ class TfElement extends LitElement {
}
channel_set_unread(event) {
console.log(event.detail.channel ?? '', event.detail.unread);
this.channels_unread[event.detail.channel ?? ''] = event.detail.unread;
this.channels_unread = Object.assign({}, this.channels_unread);
console.log(this.channels_unread);
tfrpc.rpc.databaseSet('unread', JSON.stringify(this.channels_unread));
}