Skip to content

Commit

Permalink
Hide outdated comments in file view (#5017)
Browse files Browse the repository at this point in the history
* Hide outdated comments in file view

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add unit test by adding "invalidated" comment to fixtures

Signed-off-by: Jonas Franz <info@jonasfranz.software>
  • Loading branch information
jonasfranz authored and techknowlogick committed Oct 5, 2018
1 parent d7ca839 commit 94cd7bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions models/fixtures/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@
tree_path: "README.md"
created_unix: 946684812
invalidated: false

-
id: 6
type: 21 # code comment
poster_id: 1
issue_id: 2
content: "it's already invalidated. boring..."
line: -4
tree_path: "README.md"
created_unix: 946684812
invalidated: true
2 changes: 1 addition & 1 deletion models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
}
conds := opts.toConds()
if review.ID == 0 {
conds.And(builder.Eq{"invalidated": false})
conds = conds.And(builder.Eq{"invalidated": false})
}

var comments []*Comment
Expand Down

0 comments on commit 94cd7bb

Please sign in to comment.