mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-08 03:50:21 +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
@@ -12,6 +12,7 @@ export default function HuntNotStarted() {
|
||||
// Add aggressive hunt status checking
|
||||
useEffect(() => {
|
||||
let redirectAttempted = false;
|
||||
let huntWasActive = null;
|
||||
|
||||
// Function to check hunt status
|
||||
async function checkHuntStatus() {
|
||||
@@ -32,11 +33,22 @@ export default function HuntNotStarted() {
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
|
||||
// Check if hunt ended (was active before but not active now)
|
||||
if (huntWasActive === true && !data.active) {
|
||||
console.log("Hunt ended! Redirecting to leaderboard");
|
||||
redirectAttempted = true;
|
||||
window.location.replace("/leaderboard?huntEnded=true");
|
||||
return;
|
||||
}
|
||||
|
||||
// If hunt becomes active while on this page, immediately redirect to map
|
||||
if (data.active) {
|
||||
huntWasActive = true;
|
||||
console.log("Hunt now active! Redirecting to map page");
|
||||
redirectAttempted = true;
|
||||
window.location.replace("/map");
|
||||
} else {
|
||||
huntWasActive = false;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user