From 090d89e0f9db2bbbe6bc63d887647e2f898c0a18 Mon Sep 17 00:00:00 2001 From: Mai-Lapyst <67418776+Mai-Lapyst@users.noreply.github.com> Date: Sat, 4 Jun 2022 22:12:14 +0200 Subject: [PATCH] Fixing wrong paging when filtering on the issue dashboard (#19801) Fixes #19791 by adding an check if filtering after any repo; if yes, simply set the total count for the pageing to the sum of the issue count for each selected repo by utilize `issueCountByRepo`. Fix #19791 --- routers/web/user/home.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 297d76d4aa..1412f6cfef 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -610,6 +610,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { shownIssues = int(issueStats.ClosedCount) ctx.Data["TotalIssueCount"] = shownIssues } + if len(repoIDs) != 0 { + shownIssues = 0 + for _, repoID := range repoIDs { + shownIssues += int(issueCountByRepo[repoID]) + } + } ctx.Data["IsShowClosed"] = isShowClosed