mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-07 19:50:20 +00:00
fixed map display and fixed some routing issues for if the hunt timer runs out.
Grey = cant click Red = current Green = complete blue = skipped?
This commit is contained in:
1 parent
0afa6817a8
commit
6d1cbe9195
5 files changed
+67
-27
No files matched your search
+16
-1
@@ -17,6 +17,7 @@ export default function WaitingPage() {
|
||||
useEffect(() => {
|
||||
let redirectAttempted = false;
|
||||
let lastKnownHuntStatus = false;
|
||||
let lastHuntData = null;
|
||||
|
||||
async function checkHuntStatus() {
|
||||
if (redirectAttempted) return;
|
||||
@@ -102,8 +103,22 @@ export default function WaitingPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
// If this is a new session but we detect signs of a hunt that ended
|
||||
if (!lastHuntData && !data.active && data.startTime && data.endTime) {
|
||||
// Handle case where user lands directly on waiting page after hunt ended
|
||||
console.log("Hunt appears to have already ended");
|
||||
setHuntEnded(true);
|
||||
|
||||
// Redirect to leaderboard after a brief delay
|
||||
setTimeout(() => {
|
||||
window.location.href = "/leaderboard?huntEnded=true";
|
||||
}, 2000);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Save the current hunt data for next comparison
|
||||
setLastHuntData(data);
|
||||
lastHuntData = data;
|
||||
|
||||
if (data.active) {
|
||||
// Store the global start time in the centralized timer service
|
||||
|
||||
Reference in new issue
Block a user