aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/GolfWatchApp.client.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-12 01:23:54 +0900
committernsfisis <nsfisis@gmail.com>2024-08-12 01:23:54 +0900
commit5964fa404909550a2dd42a75633fef223fdb05fb (patch)
treed282d098690d0a85930d89ff68f47507c0eb5d7c /frontend/app/components/GolfWatchApp.client.tsx
parent8c7d882dfa67bcef37a4f39be6f1ca57f160b816 (diff)
downloadphperkaigi-2025-albatross-5964fa404909550a2dd42a75633fef223fdb05fb.tar.gz
phperkaigi-2025-albatross-5964fa404909550a2dd42a75633fef223fdb05fb.tar.zst
phperkaigi-2025-albatross-5964fa404909550a2dd42a75633fef223fdb05fb.zip
feat: do not show preliminary score
Diffstat (limited to 'frontend/app/components/GolfWatchApp.client.tsx')
-rw-r--r--frontend/app/components/GolfWatchApp.client.tsx14
1 files changed, 6 insertions, 8 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 =