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 (