From ecfc3cb3f069aed48fec14b38d4db816cff7f77d Mon Sep 17 00:00:00 2001 From: oliverpool Date: Fri, 2 Feb 2024 10:40:27 +0100 Subject: [PATCH] [GITEA] always load outdated comments (cherry picked from commit 2615dea9af10b9400bdf96cf8c3cf7c6e349d5ed) --- routers/web/repo/pull_review.go | 2 +- templates/repo/issue/view_content/conversation.tmpl | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/routers/web/repo/pull_review.go b/routers/web/repo/pull_review.go index 156b70a999..e399176a4a 100644 --- a/routers/web/repo/pull_review.go +++ b/routers/web/repo/pull_review.go @@ -153,7 +153,7 @@ func UpdateResolveConversation(ctx *context.Context) { } func renderConversation(ctx *context.Context, comment *issues_model.Comment, origin string) { - comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, ctx.Data["ShowOutdatedComments"].(bool)) + comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, true) if err != nil { ctx.ServerError("FetchCodeCommentsByLine", err) return diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl index c9e5ee6275..0e978dafcd 100644 --- a/templates/repo/issue/view_content/conversation.tmpl +++ b/templates/repo/issue/view_content/conversation.tmpl @@ -1,6 +1,7 @@ {{$invalid := (index .comments 0).Invalidated}} {{$resolved := (index .comments 0).IsResolved}} {{$resolveDoer := (index .comments 0).ResolveDoer}} +{{$hideByDefault := or $resolved (and $invalid (not .ShowOutdatedComments))}} {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}
@@ -14,7 +15,7 @@
{{if or $invalid $resolved}} - -