No challenges are returned when event is not started.
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user