From 0dc3607cf7a47df38267296e08cdef57602088c4 Mon Sep 17 00:00:00 2001 From: Epid Date: Thu, 2 Apr 2026 03:59:13 +0300 Subject: [PATCH] fix(stopwatch): publish empty-stopwatches push on stop, not only cancel --- routers/web/repo/issue_stopwatch.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/routers/web/repo/issue_stopwatch.go b/routers/web/repo/issue_stopwatch.go index a228bf779a..81ee07f140 100644 --- a/routers/web/repo/issue_stopwatch.go +++ b/routers/web/repo/issue_stopwatch.go @@ -51,6 +51,16 @@ func IssueStopStopwatch(c *context.Context) { } else if !ok { c.Flash.Warning(c.Tr("repo.issues.stopwatch_already_stopped")) } + + stopwatches, err := issues_model.GetUserStopwatches(c, c.Doer.ID, db.ListOptions{}) + if err != nil { + c.ServerError("GetUserStopwatches", err) + return + } + if len(stopwatches) == 0 { + websocket_service.PublishEmptyStopwatches(c.Doer.ID) + } + c.JSONRedirect("") }