No challenges are returned when event is not started.

This commit is contained in:
m0rph3us1987
2026-02-28 01:32:18 +01:00
parent 6127bfbeb2
commit d33a1c6a72
2 changed files with 5 additions and 3 deletions

View File

@@ -211,7 +211,9 @@ apiRouter.get('/state', async (req, res) => {
if (err) return res.status(500).json({ error: 'Failed to fetch blogs' });
state.solves = solves || [];
state.blogs = blogs || [];
if (!teamId || (!isAdmin && !state.isStarted)) {
const startTime = parseInt(state.config.eventStartTime || "0", 10);
const isBeforeStart = Date.now() < startTime;
if (!teamId || (!isAdmin && (!state.isStarted || isBeforeStart))) {
state.challenges = [];
} else {
state.challenges = (challenges || []).map(c => {