Jelajahi Sumber

fix comments order

Yuki Takei 6 tahun lalu
induk
melakukan
01251a070c
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      src/client/js/components/PageComments.jsx

+ 2 - 1
src/client/js/components/PageComments.jsx

@@ -191,7 +191,8 @@ class PageComments extends React.Component {
   render() {
     const topLevelComments = [];
     const allReplies = [];
-    const comments = this.props.commentContainer.state.comments;
+    const comments = this.props.commentContainer.state.comments
+      .slice().reverse(); // create shallow copy and reverse
 
     comments.forEach((comment) => {
       if (comment.replyTo === undefined) {