aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/components')
-rw-r--r--frontend/app/components/GolfWatchApp.client.tsx14
-rw-r--r--frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx7
2 files changed, 8 insertions, 13 deletions
diff --git a/frontend/app/components/GolfWatchApp.client.tsx b/frontend/app/components/GolfWatchApp.client.tsx
index 448a966..1da2066 100644
--- a/frontend/app/components/GolfWatchApp.client.tsx
+++ b/frontend/app/components/GolfWatchApp.client.tsx
@@ -121,14 +121,13 @@ export default function GolfWatchApp({
player_id === playerA?.user_id ? setPlayerInfoA : setPlayerInfoB;
setter((prev) => ({ ...prev, code }));
} else if (lastJsonMessage.type === "watcher:s2c:submit") {
- const { player_id, preliminary_score } = lastJsonMessage.data;
+ const { player_id } = lastJsonMessage.data;
const setter =
player_id === playerA?.user_id ? setPlayerInfoA : setPlayerInfoB;
setter((prev) => ({
...prev,
submissionResult: {
status: "running",
- preliminaryScore: preliminary_score,
verificationResults: game.verification_steps.map((v) => ({
testcase_id: v.testcase_id,
status: "running",
@@ -165,7 +164,7 @@ export default function GolfWatchApp({
return ret;
});
} else if (lastJsonMessage.type === "watcher:s2c:submitresult") {
- const { player_id, status } = lastJsonMessage.data;
+ const { player_id, status, score } = lastJsonMessage.data;
const setter =
player_id === playerA?.user_id ? setPlayerInfoA : setPlayerInfoB;
setter((prev) => {
@@ -178,11 +177,10 @@ export default function GolfWatchApp({
status,
};
if (status === "success") {
- if (
- ret.score === null ||
- ret.submissionResult.preliminaryScore < ret.score
- ) {
- ret.score = ret.submissionResult.preliminaryScore;
+ if (score) {
+ if (ret.score === null || score < ret.score) {
+ ret.score = score;
+ }
}
} else {
ret.submissionResult.verificationResults =
diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx
index 65cd35e..173e8e3 100644
--- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx
+++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx
@@ -24,7 +24,6 @@ type SubmissionResult = {
| "compile_error"
| "runtime_error"
| "internal_error";
- preliminaryScore: number;
verificationResults: VerificationResult[];
};
@@ -120,8 +119,7 @@ export default function GolfWatchAppGaming({
<div>
{submissionResultStatusToLabel(
playerInfoA.submissionResult?.status ?? null,
- )}{" "}
- ({playerInfoA.submissionResult?.preliminaryScore})
+ )}
</div>
<div>
<ol>
@@ -153,8 +151,7 @@ export default function GolfWatchAppGaming({
<div>
{submissionResultStatusToLabel(
playerInfoB.submissionResult?.status ?? null,
- )}{" "}
- ({playerInfoB.submissionResult?.preliminaryScore ?? "-"})
+ )}
</div>
<div>
<ol>