diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-12 01:54:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-12 01:54:36 +0900 |
| commit | ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f (patch) | |
| tree | 57f4b6da4682ec43cbd7ba2a51c5866f226b0035 /frontend/app/components/GolfWatchApp.client.tsx | |
| parent | b97b245861b93a5ab5f8bde095d9920fabd0cbbd (diff) | |
| download | iosdc-japan-2024-albatross-ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f.tar.gz iosdc-japan-2024-albatross-ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f.tar.zst iosdc-japan-2024-albatross-ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f.zip | |
refactor(frontend): rename SubmissionResult and VerificationResult for consistant naming
Diffstat (limited to 'frontend/app/components/GolfWatchApp.client.tsx')
| -rw-r--r-- | frontend/app/components/GolfWatchApp.client.tsx | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/frontend/app/components/GolfWatchApp.client.tsx b/frontend/app/components/GolfWatchApp.client.tsx index 3f97d2a..7041572 100644 --- a/frontend/app/components/GolfWatchApp.client.tsx +++ b/frontend/app/components/GolfWatchApp.client.tsx @@ -78,14 +78,14 @@ export default function GolfWatchApp({ iconPath: playerA?.icon_path ?? null, score: null, code: "", - submissionResult: undefined, + submitResult: undefined, }); const [playerInfoB, setPlayerInfoB] = useState<PlayerInfo>({ displayName: playerB?.display_name ?? null, iconPath: playerB?.icon_path ?? null, score: null, code: "", - submissionResult: undefined, + submitResult: undefined, }); if (readyState === ReadyState.UNINSTANTIATED) { @@ -125,12 +125,12 @@ export default function GolfWatchApp({ player_id === playerA?.user_id ? setPlayerInfoA : setPlayerInfoB; setter((prev) => ({ ...prev, - submissionResult: { + submitResult: { status: "running", - verificationResults: game.verification_steps.map((v) => ({ - testcase_id: v.testcase_id, + execResults: game.verification_steps.map((r) => ({ + testcase_id: r.testcase_id, status: "running", - label: v.label, + label: r.label, stdout: "", stderr: "", })), @@ -143,21 +143,20 @@ export default function GolfWatchApp({ player_id === playerA?.user_id ? setPlayerInfoA : setPlayerInfoB; setter((prev) => { const ret = { ...prev }; - if (ret.submissionResult === undefined) { + if (ret.submitResult === undefined) { return ret; } - ret.submissionResult = { - ...ret.submissionResult, - verificationResults: ret.submissionResult.verificationResults.map( - (v) => - v.testcase_id === testcase_id && v.status === "running" - ? { - ...v, - status, - stdout, - stderr, - } - : v, + ret.submitResult = { + ...ret.submitResult, + execResults: ret.submitResult.execResults.map((r) => + r.testcase_id === testcase_id && r.status === "running" + ? { + ...r, + status, + stdout, + stderr, + } + : r, ), }; return ret; @@ -168,11 +167,11 @@ export default function GolfWatchApp({ player_id === playerA?.user_id ? setPlayerInfoA : setPlayerInfoB; setter((prev) => { const ret = { ...prev }; - if (ret.submissionResult === undefined) { + if (ret.submitResult === undefined) { return ret; } - ret.submissionResult = { - ...ret.submissionResult, + ret.submitResult = { + ...ret.submitResult, status, }; if (status === "success") { @@ -182,10 +181,10 @@ export default function GolfWatchApp({ } } } else { - ret.submissionResult.verificationResults = - ret.submissionResult.verificationResults.map((v) => - v.status === "running" ? { ...v, status: "canceled" } : v, - ); + ret.submitResult.execResults = ret.submitResult.execResults.map( + (r) => + r.status === "running" ? { ...r, status: "canceled" } : r, + ); } return ret; }); |
