瀏覽代碼

Default to showing closed Issues/PR list when there are only closed issues/PRs (#12200)

If all issues are closed, then set the default to show the closed issues.
tags/v1.13.0-rc1
6543 3 年之前
父節點
當前提交
16980d13ce
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. 7
    1
      routers/repo/issue.go

+ 7
- 1
routers/repo/issue.go 查看文件

@@ -139,7 +139,6 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
return
}
}
isShowClosed := ctx.Query("state") == "closed"

keyword := strings.Trim(ctx.Query("q"), " ")
if bytes.Contains([]byte(keyword), []byte{0x00}) {
@@ -177,6 +176,13 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
return
}
}

isShowClosed := ctx.Query("state") == "closed"
// if open issues are zero and close don't, use closed as default
if len(ctx.Query("state")) == 0 && issueStats.OpenCount == 0 && issueStats.ClosedCount != 0 {
isShowClosed = true
}

page := ctx.QueryInt("page")
if page <= 1 {
page = 1

Loading…
取消
儲存