Skip to content

Commit 94cd7bb

Browse files
jonasfranztechknowlogick
authored andcommitted
Hide outdated comments in file view (#5017)
* Hide outdated comments in file view Signed-off-by: Jonas Franz <[email protected]> * Add unit test by adding "invalidated" comment to fixtures Signed-off-by: Jonas Franz <[email protected]>
1 parent d7ca839 commit 94cd7bb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

models/fixtures/comment.yml

+11
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@
4141
tree_path: "README.md"
4242
created_unix: 946684812
4343
invalidated: false
44+
45+
-
46+
id: 6
47+
type: 21 # code comment
48+
poster_id: 1
49+
issue_id: 2
50+
content: "it's already invalidated. boring..."
51+
line: -4
52+
tree_path: "README.md"
53+
created_unix: 946684812
54+
invalidated: true

models/issue_comment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
10841084
}
10851085
conds := opts.toConds()
10861086
if review.ID == 0 {
1087-
conds.And(builder.Eq{"invalidated": false})
1087+
conds = conds.And(builder.Eq{"invalidated": false})
10881088
}
10891089

10901090
var comments []*Comment

0 commit comments

Comments
 (0)