fix: incorrect author uid saved in topic

This commit is contained in:
Julian Lam
2024-01-16 12:00:40 -05:00
parent 8cd3ff1ab4
commit 7565485204

View File

@@ -86,7 +86,7 @@ Notes.assertTopic = async (uid, id) => {
*/
const chain = Array.from(await Notes.getParentChain(uid, id));
const tid = chain[chain.length - 1].pid;
const { pid: tid, uid: authorId } = chain[chain.length - 1];
const members = await db.isSortedSetMembers(`tidRemote:${tid}:posts`, chain.map(p => p.pid));
if (members.every(Boolean)) {
@@ -106,7 +106,7 @@ Notes.assertTopic = async (uid, id) => {
await Promise.all([
db.setObject(`topicRemote:${tid}`, {
tid,
uid,
uid: authorId,
cid: -1,
mainPid: tid,
title: 'TBD',