From: Dessalines Date: Wed, 27 Mar 2019 18:37:16 +0000 (-0700) Subject: Adding correct comment ordering X-Git-Url: http://these/git/%24%7Bk%5B1%5D.custom_emoji.image_url%7D?a=commitdiff_plain;h=2b08fe5be98ba1de0dc3c16f2f3f25ce3c2b262c;p=lemmy.git Adding correct comment ordering --- diff --git a/server/src/actions/comment.rs b/server/src/actions/comment.rs index ceedf294..93e808a4 100644 --- a/server/src/actions/comment.rs +++ b/server/src/actions/comment.rs @@ -103,6 +103,7 @@ impl Comment { pub fn from_post(conn: &PgConnection, post: &Post) -> Result, Error> { use schema::community::dsl::*; Comment::belonging_to(post) + .order_by(comment::published.desc()) .load::(conn) } } diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index 193da3de..5e383c09 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -131,7 +131,7 @@ export class Post extends Component { commentsTree() { let nodes = this.buildCommentsTree(); return ( -
+
); @@ -147,7 +147,7 @@ export class Post extends Component { } else if (op == UserOperation.GetPost) { let res: PostResponse = msg; this.state.post = res.post; - this.state.comments = res.comments.reverse(); + this.state.comments = res.comments; this.setState(this.state); } else if (op == UserOperation.CreateComment) { let res: CommentResponse = msg; @@ -177,10 +177,11 @@ export class CommentNodes extends Component {this.props.nodes.map(node => -
-
-
▲
-
▼
+
+
+
▲
+
20
+
▼
    @@ -189,7 +190,7 @@ export class CommentNodes extends Component
  • ( - 1300 + +1300 | -29 ) points diff --git a/ui/src/main.css b/ui/src/main.css index cb2d53d4..30fbc8dc 100644 --- a/ui/src/main.css +++ b/ui/src/main.css @@ -1,3 +1,14 @@ + + + .pointer { cursor: pointer; } + +.upvote:hover { + color: var(--info); +} + +.downvote:hover { + color: var(--danger); +}