mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Hide outdated comments in file view (#5017)
* 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>
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							d7ca839c67
						
					
				
				
					commit
					94cd7bb25b
				
			@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user