From 1bf0990774ce8fdf4c5cf1a2e362505d0b8dae13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 15 Oct 2024 10:59:13 -0400 Subject: [PATCH] fix: groups not showing up on new reply --- src/topics/create.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/topics/create.js b/src/topics/create.js index 20bd127587..9204c4232c 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -228,8 +228,11 @@ module.exports = function (Topics) { return postData; }; - async function onNewPost({ pid, tid }, { uid }) { - const postData = (await posts.getPostSummaryByPids([pid], uid, {})).pop(); + async function onNewPost({ pid, tid, uid: postOwner }, { uid }) { + const [[postData], [userInfo]] = await Promise.all([ + posts.getPostSummaryByPids([pid], uid, {}), + posts.getUserInfoForPosts([postOwner], uid), + ]); await Promise.all([ Topics.addParentPosts([postData]), Topics.syncBacklinks(postData), @@ -237,6 +240,7 @@ module.exports = function (Topics) { ]); // Returned data is a superset of post summary data + postData.user = userInfo; postData.index = postData.topic.postcount - 1; postData.bookmarked = false; postData.display_edit_tools = true;