mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Backport #29050 by wxiaoguang Try to improve #28949 1. Make `ctx.Data["ShowOutdatedComments"] = true` by default: it brings consistent user experience, and sometimes the "outdated (source changed)" comments are still valuable. 2. Show a friendly message if the comment won't show, then the end users won't fell that "the comment disappears" (it is the special case when `ShowOutdatedComments = false`) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -22,6 +22,7 @@ import ( | ||||
|  | ||||
| const ( | ||||
| 	tplDiffConversation     base.TplName = "repo/diff/conversation" | ||||
| 	tplConversationOutdated base.TplName = "repo/diff/conversation_outdated" | ||||
| 	tplTimelineConversation base.TplName = "repo/issue/view_content/conversation" | ||||
| 	tplNewComment           base.TplName = "repo/diff/new_comment" | ||||
| ) | ||||
| @@ -161,8 +162,8 @@ func renderConversation(ctx *context.Context, comment *issues_model.Comment, ori | ||||
| 		return | ||||
| 	} | ||||
| 	if len(comments) == 0 { | ||||
| 		// if the comments are empty (deleted, outdated, etc), it doesn't need to render anything, just return an empty body to replace "conversation-holder" on the page | ||||
| 		ctx.Resp.WriteHeader(http.StatusOK) | ||||
| 		// if the comments are empty (deleted, outdated, etc), it's better to tell the users that it is outdated | ||||
| 		ctx.HTML(http.StatusOK, tplConversationOutdated) | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user