diff --git a/src/app/(frontend)/eod/custom/page.tsx b/src/app/(frontend)/eod/custom/page.tsx index b7a03d2..b56527a 100644 --- a/src/app/(frontend)/eod/custom/page.tsx +++ b/src/app/(frontend)/eod/custom/page.tsx @@ -4,6 +4,7 @@ import { getPayload } from "payload"; import { headers as nextHeaders } from "next/headers"; import { Bomb } from "lucide-react"; import { CustomMinefieldBrowser } from "@/components/frontend/eod/CustomMinefieldBrowser"; +import { isEodUnlocked } from "@/lib/custom-minigames/eod"; export const metadata: Metadata = { title: "Custom Minefields (Polaris Task Force)", @@ -28,10 +29,11 @@ export default async function CustomMinefieldsPage() { }) ).docs[0]?.progression?.minigames?.eodMinesweeper ?? {} : {}; - const unlocked = - (eod.bestTrainingTime ?? 0) > 0 && - (eod.bestPerimeterTime ?? 0) > 0 && - (eod.bestSupplyRoadTime ?? 0) > 0; + const unlocked = isEodUnlocked({ + bestTrainingTime: eod.bestTrainingTime ?? 0, + bestPerimeterTime: eod.bestPerimeterTime ?? 0, + bestSupplyRoadTime: eod.bestSupplyRoadTime ?? 0, + }); return (
diff --git a/src/app/(frontend)/radio/custom/page.tsx b/src/app/(frontend)/radio/custom/page.tsx index e25fea4..c55dd8e 100644 --- a/src/app/(frontend)/radio/custom/page.tsx +++ b/src/app/(frontend)/radio/custom/page.tsx @@ -4,6 +4,7 @@ import { getPayload } from "payload"; import { headers as nextHeaders } from "next/headers"; import { Radio } from "lucide-react"; import { CustomTestBrowser } from "@/components/frontend/radio/CustomTestBrowser"; +import { isRadioUnlocked } from "@/lib/custom-minigames/radio"; export const metadata: Metadata = { title: "Custom Radio Tests (Polaris Task Force)", @@ -28,8 +29,10 @@ export default async function CustomRadioTestsPage() { }) ).docs[0]?.progression?.minigames?.radioTraffic ?? {} : {}; - const unlocked = - (radio.sprintBestAccuracy ?? 0) >= 0.9 && (radio.watchBestAccuracy ?? 0) >= 0.85; + const unlocked = isRadioUnlocked({ + sprintBestAccuracy: radio.sprintBestAccuracy ?? 0, + watchBestAccuracy: radio.watchBestAccuracy ?? 0, + }); return (