From 0c6fc6ea11fde713125aaf6bc64464644386d8d2 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 15 Dec 2016 14:43:09 +0530 Subject: [PATCH] Github issue#587, Comments Sort order within a topic is incorrect -- Fixed. We were missing sorting the posts when loading more posts for a feed --- src/projects/reducers/projectTopics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/projects/reducers/projectTopics.js b/src/projects/reducers/projectTopics.js index 27ee4ee96..c3fa25651 100644 --- a/src/projects/reducers/projectTopics.js +++ b/src/projects/reducers/projectTopics.js @@ -157,6 +157,7 @@ export const projectTopics = function (state=initialState, action) { posts: { $push: payload.posts }, isLoadingComments: { $set : false } }) + updatedFeed.posts = _.sortBy(updatedFeed.posts, ['id']) const feedUpdateQuery = {} feedUpdateQuery[tag] = { topics: { $splice: [[feedIndex, 1, updatedFeed]] } } // update the state