This commit is contained in:
2026-04-16 02:02:34 -07:00
21 changed files with 336 additions and 82 deletions

View File

@@ -395,6 +395,25 @@ export async function buildReplyCountMap() {
}
return { direct, recursive };
}
export async function getPostById(postID) {
const knownUsers = [...(await indexedDB.databases())]
.map(db => db.name?.replace('user_', '')).filter(Boolean);
for (const userID of knownUsers) {
try {
const { store } = await getDBTransactionStore(userID);
const index = store.index("postIDIndex");
const result = await new Promise((resolve, reject) => {
const req = index.get(postID);
req.onsuccess = () => resolve(req.result);
req.onerror = () => reject(req.error);
});
if (result)
return result;
}
catch (_) { }
}
return undefined;
}
export async function getRepliesForPost(postID) {
const knownUsers = [...(await indexedDB.databases())]
.map(db => db.name?.replace('user_', '')).filter(Boolean);