client/comments: fix sort order
Each time the user clicked 'comments' tab, the comments were reversed.
This commit is contained in:
parent
3cbcbf1140
commit
e800e6c21b
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ class CommentsPageView {
|
||||||
const source = this._template(ctx);
|
const source = this._template(ctx);
|
||||||
|
|
||||||
for (let post of ctx.results) {
|
for (let post of ctx.results) {
|
||||||
post.comments.reverse();
|
post.comments.sort((a, b) => { return b.id - a.id; });
|
||||||
new CommentListControl(
|
new CommentListControl(
|
||||||
source.querySelector(
|
source.querySelector(
|
||||||
`.comments-container[data-for="${post.id}"]`),
|
`.comments-container[data-for="${post.id}"]`),
|
||||||
|
|
Loading…
Reference in a new issue