Skip to content

Fix issues/pulls dashboard paging error #9998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions routers/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,14 +465,6 @@ func Issues(ctx *context.Context) {
opts.MentionedID = ctxUser.ID
}

counts, err := models.CountIssuesByRepo(opts)
if err != nil {
ctx.ServerError("CountIssuesByRepo", err)
return
}

opts.Page = page
opts.PageSize = setting.UI.IssuePagingNum
var labelIDs []int64
selectLabels := ctx.Query("labels")
if len(selectLabels) > 0 && selectLabels != "0" {
Expand All @@ -488,6 +480,15 @@ func Issues(ctx *context.Context) {
opts.RepoIDs = repoIDs
}

counts, err := models.CountIssuesByRepo(opts)
if err != nil {
ctx.ServerError("CountIssuesByRepo", err)
return
}

opts.Page = page
opts.PageSize = setting.UI.IssuePagingNum

issues, err := models.Issues(opts)
if err != nil {
ctx.ServerError("Issues", err)
Expand Down Expand Up @@ -538,13 +539,18 @@ func Issues(ctx *context.Context) {
}
}

issueStats, err := models.GetUserIssueStats(models.UserIssueStatsOptions{
issueStatsOpts := models.UserIssueStatsOptions{
UserID: ctxUser.ID,
UserRepoIDs: userRepoIDs,
FilterMode: filterMode,
IsPull: isPullList,
IsClosed: isShowClosed,
})
}
if len(repoIDs) > 0 {
issueStatsOpts.UserRepoIDs = repoIDs
}

issueStats, err := models.GetUserIssueStats(issueStatsOpts)
if err != nil {
ctx.ServerError("GetUserIssueStats", err)
return
Expand Down