From 889d49f95542b0515f9e4a69fd6a49d3b5b1b6ca Mon Sep 17 00:00:00 2001 From: rngsurrounded Date: Mon, 3 Mar 2025 17:36:54 +0900 Subject: [PATCH] input hotfix --- services/frontend/src/pages/CompetitionSession/index.tsx | 3 +++ .../pages/CompetitionSession/modules/TaskSolution/index.tsx | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/services/frontend/src/pages/CompetitionSession/index.tsx b/services/frontend/src/pages/CompetitionSession/index.tsx index 5c8e7c1..4d0c5f8 100644 --- a/services/frontend/src/pages/CompetitionSession/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/index.tsx @@ -44,6 +44,9 @@ const CompetitionSession = () => { queryClient.invalidateQueries({ queryKey: ['solutionHistory', competitionId, taskId] }); + + setAnswer(""); + setSelectedFile(null); }, onError: (error) => { console.error("Error submitting solution:", error); diff --git a/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx b/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx index a463cde..06cebdd 100644 --- a/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx @@ -40,12 +40,9 @@ const TaskSolution: React.FC = ({ enabled: !!(competitionId && task.id), }); - // Get the solution history - already sorted from oldest to newest const solutionHistory = solutionsQuery.data || []; - // Handle task changes useEffect(() => { - // If task changed, reset everything and load the latest solution if (taskIdRef.current !== task.id) { setCurrentSolution(null); setSelectedSolutionUrl(null); @@ -115,9 +112,6 @@ const TaskSolution: React.FC = ({ const handleSubmitWrapper = () => { onSubmit(); - setAnswer(""); - setSelectedFile(null); - setSelectedSolutionUrl(null); }; return (