Skip to content

Commit 49b51cb

Browse files
committed
Revert "Do not render empty comments (go-gitea#29039)"
This reverts commit b4513f4.
1 parent 036f1ed commit 49b51cb

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

routers/web/repo/pull_review.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,12 @@ func UpdateResolveConversation(ctx *context.Context) {
153153
}
154154

155155
func renderConversation(ctx *context.Context, comment *issues_model.Comment, origin string) {
156-
ctx.Data["PageIsPullFiles"] = origin == "diff"
157-
158156
comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, ctx.Data["ShowOutdatedComments"].(bool))
159157
if err != nil {
160158
ctx.ServerError("FetchCodeCommentsByLine", err)
161159
return
162160
}
163-
if len(comments) == 0 {
164-
// 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
165-
ctx.Resp.WriteHeader(http.StatusOK)
166-
return
167-
}
168-
161+
ctx.Data["PageIsPullFiles"] = (origin == "diff")
169162
ctx.Data["comments"] = comments
170163
if ctx.Data["CanMarkConversation"], err = issues_model.CanMarkConversation(ctx, comment.Issue, ctx.Doer); err != nil {
171164
ctx.ServerError("CanMarkConversation", err)
@@ -186,8 +179,6 @@ func renderConversation(ctx *context.Context, comment *issues_model.Comment, ori
186179
ctx.HTML(http.StatusOK, tplDiffConversation)
187180
} else if origin == "timeline" {
188181
ctx.HTML(http.StatusOK, tplTimelineConversation)
189-
} else {
190-
ctx.Error(http.StatusBadRequest, "Unknown origin: "+origin)
191182
}
192183
}
193184

0 commit comments

Comments
 (0)