From dd541bfa7940959ab8a1d93d58a24cc277c51e48 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 22 Aug 2024 15:47:28 +0900 Subject: fix(frontend): workaround exec result --- frontend/app/states/play.ts | 5 +++++ frontend/app/states/watch.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/frontend/app/states/play.ts b/frontend/app/states/play.ts index 13bd39f..1684367 100644 --- a/frontend/app/states/play.ts +++ b/frontend/app/states/play.ts @@ -172,6 +172,11 @@ export const handleWsSubmitResultMessageAtom = atom( newResult.execResults = prev.execResults.map((r) => r.status === "running" ? { ...r, status: "canceled" } : r, ); + } else { + newResult.execResults = prev.execResults.map((r) => ({ + ...r, + status: "success", + })); } set(submitResultAtom, newResult); if (status === "success" && score !== null) { diff --git a/frontend/app/states/watch.ts b/frontend/app/states/watch.ts index ba3dd2a..5f5c4db 100644 --- a/frontend/app/states/watch.ts +++ b/frontend/app/states/watch.ts @@ -235,6 +235,11 @@ export const handleWsSubmitResultMessageAtom = atom( newResult.execResults = prev.execResults.map((r) => r.status === "running" ? { ...r, status: "canceled" } : r, ); + } else { + newResult.execResults = prev.execResults.map((r) => ({ + ...r, + status: "success", + })); } set(submitResultAtom, newResult); if (status === "success" && score !== null) { -- cgit v1.2.3-70-g09d2