Skip to content

Commit 8c5f241

Browse files
sebastian-sauerGiteaBot
authored andcommitted
Use AfterCommitId to get commit for Viewed functionality (go-gitea#25529)
the PullHeadCommitID is not always available when the PR is merged. Not sure if this is the best solution but in my simple tests it looks like this fixes the problem - happy to get any feedback. hopefully fixes go-gitea#24813
1 parent 24cf065 commit 8c5f241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/repo/diff/box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
{{end}}
148148
{{end}}
149149
{{if $isReviewFile}}
150-
<label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.PullHeadCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
150+
<label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.AfterCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
151151
<input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{$.locale.Tr "repo.pulls.has_viewed_file"}}
152152
</label>
153153
{{end}}

0 commit comments

Comments
 (0)