From ad67d9ef1a219b21309f811c14e7353cbc4982e3 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 --- 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 f12fb0c965..29f8504e36 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}} - -