From e800e6c21b5c9e954c3c4f8cbf0430a8037decc3 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 12 Jun 2016 22:18:45 +0200 Subject: [PATCH] client/comments: fix sort order Each time the user clicked 'comments' tab, the comments were reversed. --- client/js/views/comments_page_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/views/comments_page_view.js b/client/js/views/comments_page_view.js index ed741ef..9816beb 100644 --- a/client/js/views/comments_page_view.js +++ b/client/js/views/comments_page_view.js @@ -13,7 +13,7 @@ class CommentsPageView { const source = this._template(ctx); for (let post of ctx.results) { - post.comments.reverse(); + post.comments.sort((a, b) => { return b.id - a.id; }); new CommentListControl( source.querySelector( `.comments-container[data-for="${post.id}"]`),