Skip to content

Commit c75039f

Browse files
Uttam-Mahataclaude
andcommitted
fix: only show live contests on scoreboard, hide ended ones
Filter out ended contests from the /contests/active endpoint so the scoreboard only displays running or upcoming contests. When all contests have ended, the frontend shows the existing "No Active Contests" empty state instead of stale scoreboards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e8a730c commit c75039f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

backend/internal/handlers/scoreboard_handler.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,18 @@ func (h *ScoreboardHandler) GetScoreboardContests(c *gin.Context) {
194194
if contest.GetScoreboardVisibility() == "hidden" {
195195
continue
196196
}
197+
// Only show live (running or upcoming) contests on the scoreboard
198+
status := contest.Status(now)
199+
if status == "ended" {
200+
continue
201+
}
197202
result = append(result, gin.H{
198203
"id": contest.ID,
199204
"name": contest.Name,
200205
"description": contest.Description,
201206
"start_time": contest.StartTime,
202207
"end_time": contest.EndTime,
203-
"status": contest.Status(now),
208+
"status": status,
204209
"scoreboard_visibility": contest.GetScoreboardVisibility(),
205210
})
206211
}

0 commit comments

Comments
 (0)