Skip to content

Commit 74aa446

Browse files
authored
default show closed actions list if all actions was closed (#24234)
that's the same with issues and pull list
1 parent 1ef43f9 commit 74aa446

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

routers/web/repo/actions/actions.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,18 @@ func List(ctx *context.Context) {
162162
ctx.Data["NumClosedActionRuns"] = numClosedRuns
163163

164164
opts.IsClosed = util.OptionalBoolNone
165-
if ctx.FormString("state") == "closed" {
165+
isShowClosed := ctx.FormString("state") == "closed"
166+
if len(ctx.FormString("state")) == 0 && numOpenRuns == 0 && numClosedRuns != 0 {
167+
isShowClosed = true
168+
}
169+
170+
if isShowClosed {
166171
opts.IsClosed = util.OptionalBoolTrue
167172
ctx.Data["IsShowClosed"] = true
168173
} else {
169174
opts.IsClosed = util.OptionalBoolFalse
170175
}
176+
171177
runs, total, err := actions_model.FindRuns(ctx, opts)
172178
if err != nil {
173179
ctx.Error(http.StatusInternalServerError, err.Error())

0 commit comments

Comments
 (0)