Skip to content

Commit 945a0cb

Browse files
yp05327GiteaBot
andauthored
1 parent 6a7a5ea commit 945a0cb

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

routers/web/user/home.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,19 @@ func Milestones(ctx *context.Context) {
281281
}
282282
}
283283

284+
showRepoIds := make(container.Set[int64], len(showRepos))
285+
for _, repo := range showRepos {
286+
if repo.ID > 0 {
287+
showRepoIds.Add(repo.ID)
288+
}
289+
}
290+
if len(repoIDs) == 0 {
291+
repoIDs = showRepoIds.Values()
292+
}
293+
repoIDs = util.SliceRemoveAllFunc(repoIDs, func(v int64) bool {
294+
return !showRepoIds.Contains(v)
295+
})
296+
284297
var pagerCount int
285298
if isShowClosed {
286299
ctx.Data["State"] = "closed"
@@ -298,9 +311,7 @@ func Milestones(ctx *context.Context) {
298311
ctx.Data["MilestoneStats"] = milestoneStats
299312
ctx.Data["SortType"] = sortType
300313
ctx.Data["Keyword"] = keyword
301-
if milestoneStats.Total() != totalMilestoneStats.Total() {
302-
ctx.Data["RepoIDs"] = repoIDs
303-
}
314+
ctx.Data["RepoIDs"] = repoIDs
304315
ctx.Data["IsShowClosed"] = isShowClosed
305316

306317
pager := context.NewPagination(pagerCount, setting.UI.IssuePagingNum, page, 5)

0 commit comments

Comments
 (0)