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
+20
-4
@@ -483,8 +483,23 @@ export default function MapPage() {
|
||||
const data = await response.json();
|
||||
console.log("Map page hunt status check:", data);
|
||||
|
||||
// If hunt is not active, force redirect to waiting page
|
||||
// If hunt is not active, check if it was active before (hunt ended)
|
||||
if (!data.active) {
|
||||
// Check if we had an active hunt before
|
||||
const timerData = getHuntTimer();
|
||||
|
||||
if (timerData && timerData.isActive) {
|
||||
// Hunt was active before but not now - it has ended
|
||||
console.log("Hunt has ended, redirecting to leaderboard");
|
||||
clearHuntTimer();
|
||||
|
||||
if (isMounted.current) {
|
||||
hardRedirect("/leaderboard?huntEnded=true");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// If hunt was never active, redirect to waiting page
|
||||
console.log("Hunt not active, redirecting to waiting page");
|
||||
if (isMounted.current) {
|
||||
softRedirect("/waiting");
|
||||
@@ -496,7 +511,8 @@ export default function MapPage() {
|
||||
if (data.endTime && new Date(data.endTime) <= new Date()) {
|
||||
console.log("Timer expired, redirecting to leaderboard");
|
||||
if (isMounted.current) {
|
||||
softRedirect("/leaderboard?huntEnded=true");
|
||||
clearHuntTimer();
|
||||
hardRedirect("/leaderboard?huntEnded=true");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -515,7 +531,7 @@ export default function MapPage() {
|
||||
const intervalId = setInterval(checkHuntStatus, 1000);
|
||||
|
||||
return () => clearInterval(intervalId);
|
||||
}, [softRedirect]);
|
||||
}, [softRedirect, hardRedirect]);
|
||||
|
||||
if (status === "loading" || loading) {
|
||||
return (
|
||||
@@ -572,7 +588,7 @@ export default function MapPage() {
|
||||
<div className={styles["team-code"]}>{teamData?.team?.code || ""}</div>
|
||||
</div>
|
||||
|
||||
{/* Main map content area - map fills the entire container */}
|
||||
{/* Main map content area - now allows scrolling with right alignment */}
|
||||
<div className={styles["map-container"]} ref={mapContainerRef}>
|
||||
<div className={styles["treasure-map"]}>
|
||||
{mapSvg ? (
|
||||
|
||||
Reference in new issue
Block a user