feat: flesh out more topic info, fix navigator

This commit is contained in:
Julian Lam
2024-01-13 22:27:02 -05:00
parent 81d810983a
commit 7e89eadb36
3 changed files with 22 additions and 2 deletions

View File

@@ -70,6 +70,11 @@ Notes.assertTopic = async (uid, id) => {
sorted.map(n => n.timestamp),
];
const postercount = chain.reduce((set, cur) => {
set.add(cur.uid);
return set;
}, new Set());
await Promise.all([
db.setObject(`topicRemote:${tid}`, {
tid,
@@ -79,6 +84,7 @@ Notes.assertTopic = async (uid, id) => {
title: 'TBD',
slug: `remote?resource=${encodeURIComponent(tid)}`,
postcount: sorted.length,
postercount,
}),
db.sortedSetAdd(`tidRemote:${tid}:posts`, timestamps, ids),
Notes.assert(uid, chain),