From f8f0c8a3929e949d2a41c3b4e743456999835076 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 15 Nov 2016 17:55:24 +0530 Subject: [PATCH] Github issue #527, Discussions: Discussion thread not showing all posts -- Found critical issue when reviewing the code the mentioned issue. It was causing wrong posts to be shown under a topic. --- src/projects/actions/projectTopics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/projects/actions/projectTopics.js b/src/projects/actions/projectTopics.js index 9b69e9d14..bf97caa26 100644 --- a/src/projects/actions/projectTopics.js +++ b/src/projects/actions/projectTopics.js @@ -62,7 +62,7 @@ const getTopicsWithComments = (projectId, tag) => { return Promise.all(additionalPosts) .then(postArr => { _.forEach(postArr, (p) => { - const topic = _.find(topics, t => p.topicId) + const topic = _.find(topics, t => t.id === p.topicId) topic.posts = _.sortBy(topic.posts.concat(p.posts), ['id']) }) return { topics, totalCount }