Skip to content

Commit 528757b

Browse files
committed
Use the total issue count for UI
This fixes a problem where the "All" line item on the Issues or Pull Requests page was only showing the count of the selected repos instead of the total of all issues/prs in all repos. The "total number of shown issues" number is now stashed in a different context variable in case it wants to be used by the frontend later. It's currently not being used. Fixes #20574
1 parent 99efa02 commit 528757b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

routers/web/user/home.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -607,17 +607,23 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
607607
var shownIssues int
608608
if !isShowClosed {
609609
shownIssues = int(issueStats.OpenCount)
610-
ctx.Data["TotalIssueCount"] = shownIssues
611610
} else {
612611
shownIssues = int(issueStats.ClosedCount)
613-
ctx.Data["TotalIssueCount"] = shownIssues
614612
}
615613
if len(repoIDs) != 0 {
616614
shownIssues = 0
617615
for _, repoID := range repoIDs {
618616
shownIssues += int(issueCountByRepo[repoID])
619617
}
620618
}
619+
ctx.Data["TotalShownIssueCount"] = shownIssues
620+
621+
var allIssueCount int64
622+
for _, issueCount := range issueCountByRepo {
623+
allIssueCount += issueCount
624+
}
625+
ctx.Data["TotalIssueCount"] = allIssueCount
626+
621627
if len(repoIDs) == 1 {
622628
repo := showReposMap[repoIDs[0]]
623629
if repo != nil {

0 commit comments

Comments
 (0)