From 2b1a347792a7676f578ce7190fefc5030ebc1bf0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 8 Feb 2024 11:55:48 -0500 Subject: [PATCH] fix: replies to remote content overriding mainPid in topic --- src/topics/posts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topics/posts.js b/src/topics/posts.js index 2605edce31..bf967291e1 100644 --- a/src/topics/posts.js +++ b/src/topics/posts.js @@ -247,7 +247,7 @@ module.exports = function (Topics) { Topics.addPostToTopic = async function (tid, postData) { const mainPid = await Topics.getTopicField(tid, 'mainPid'); - if (!parseInt(mainPid, 10)) { + if (!mainPid) { await Topics.setTopicField(tid, 'mainPid', postData.pid); } else { const upvotes = parseInt(postData.upvotes, 10) || 0;