Skip to content

Commit 909446f

Browse files
committed
fix
1 parent 360b3fd commit 909446f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

routers/web/repo/pull_review.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,19 @@ 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+
156158
comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, ctx.Data["ShowOutdatedComments"].(bool))
157159
if err != nil {
158160
ctx.ServerError("FetchCodeCommentsByLine", err)
159161
return
160162
}
161-
ctx.Data["PageIsPullFiles"] = (origin == "diff")
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+
162169
ctx.Data["comments"] = comments
163170
if ctx.Data["CanMarkConversation"], err = issues_model.CanMarkConversation(ctx, comment.Issue, ctx.Doer); err != nil {
164171
ctx.ServerError("CanMarkConversation", err)

0 commit comments

Comments
 (0)