1
0
Fork 0

refactor(minigames): derive custom-page unlock state from shared lib predicates

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Jason Fraley 2026-09-08 22:38:38 -04:00
parent 455d705eb9
commit 76fbaba293
2 changed files with 11 additions and 6 deletions

View file

@ -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 (
<div className="flex min-w-0 flex-col gap-6 p-5">

View file

@ -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 (
<div className="flex min-w-0 flex-col gap-6 p-5">