From ffbf7212ed0a07701adaed7c3242df8afbf7e4e2 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Tue, 12 Feb 2019 18:20:46 +0000
Subject: [PATCH] GH-877: Add the comments to the front on the list

---
 .../static_src/src/app/src/redux/reducers/submissions.js  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/opentech/static_src/src/app/src/redux/reducers/submissions.js b/opentech/static_src/src/app/src/redux/reducers/submissions.js
index df94c9584..7d76f0f3e 100644
--- a/opentech/static_src/src/app/src/redux/reducers/submissions.js
+++ b/opentech/static_src/src/app/src/redux/reducers/submissions.js
@@ -39,10 +39,10 @@ function submission(state={comments: []}, action) {
         case UPDATE_NOTES:
             return {
                 ...state,
-                comments: [
-                    ...state.comments,
-                    ...action.data.results.map(note => note.id).filter(id => !state.comments.includes(id))
-                ]
+                comments: action.data.results
+                    .map(note => note.id)
+                    .filter(id => !state.comments.includes(id))
+                    .concat(state.comments)
             };
         case UPDATE_NOTE:
             return {
-- 
GitLab