mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-07 19:50:20 +00:00
fixed the map, made it so the map is scrollable and synced the timing between the admin page and map page. They now share the same elapsed time. need to fix map css for altering the svg.
Grey = cant click Red = current Green = complete blue = skipped? Need to add Clue page Need to fix Leaderboard.
This commit is contained in:
1 parent
e7ad53643c
commit
16319f1333
14 files changed
+791
-472
No files matched your search
@@ -62,6 +62,7 @@ export async function GET(request) {
|
||||
let isActive = false;
|
||||
let startTime = null;
|
||||
let endTime = null;
|
||||
let source = "none";
|
||||
|
||||
// Check all possible active indicators in priority order
|
||||
if (timerStatus && Number(timerStatus.active) === 1) {
|
||||
@@ -69,27 +70,39 @@ export async function GET(request) {
|
||||
isActive = true;
|
||||
startTime = timerStatus.start_time;
|
||||
endTime = timerStatus.end_time;
|
||||
source = "timer";
|
||||
} else if (huntStatus && huntStatus.is_active) {
|
||||
console.log("Hunt active from hunt_status table");
|
||||
isActive = true;
|
||||
startTime = huntStatus.start_time;
|
||||
endTime = huntStatus.end_time;
|
||||
source = "hunt_status";
|
||||
} else if (huntActiveSetting && huntActiveSetting.value === "true") {
|
||||
console.log("Hunt active from settings table");
|
||||
isActive = true;
|
||||
// If we have no start time but hunt is active, use current time
|
||||
if (!startTime) {
|
||||
startTime = new Date().toISOString();
|
||||
}
|
||||
source = "settings";
|
||||
} else if (oldHuntRecord && oldHuntRecord.active) {
|
||||
console.log("Hunt active from hunts table");
|
||||
isActive = true;
|
||||
startTime = oldHuntRecord.start_time;
|
||||
endTime = oldHuntRecord.end_time;
|
||||
source = "hunts";
|
||||
}
|
||||
|
||||
console.log("Hunt status check:", { isActive, startTime, endTime });
|
||||
console.log("Hunt status check:", { isActive, startTime, endTime, source });
|
||||
|
||||
// Set extremely aggressive cache control headers
|
||||
// Always include all timing data for consistency
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
active: isActive,
|
||||
startTime: startTime || null,
|
||||
endTime: endTime || null,
|
||||
source, // For debugging
|
||||
timestamp: new Date().toISOString(), // For cache-busting
|
||||
}),
|
||||
{
|
||||
status: 200,
|
||||
|
||||
Reference in new issue
Block a user