From 3ef70b770f08ce6caa5cb2ec6b87d99d4b5a7e4a Mon Sep 17 00:00:00 2001 From: rngsurrounded Date: Mon, 3 Mar 2025 20:13:33 +0900 Subject: [PATCH] fix test --- .../modules/TaskSolution/index.tsx | 44 +------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx b/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx index 87cd253..2d0df9e 100644 --- a/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/index.tsx @@ -9,8 +9,6 @@ import FileSolution from './components/FileSolution'; import CodeSolution from './components/CodeSolution'; import ActionButtons from './components/ActionButtons'; import SolutionHistorySheet from './components/SolutionHistorySheet'; -import { AlertTriangle, ArrowRight } from 'lucide-react'; -import { Button } from '@/components/ui/button'; interface TaskSolutionProps { task: Task; @@ -19,7 +17,6 @@ interface TaskSolutionProps { selectedFile: File | null; setSelectedFile: (file: File | null) => void; onSubmit: () => void; - isSubmitting?: boolean; } const TaskSolution: React.FC = ({ @@ -29,7 +26,6 @@ const TaskSolution: React.FC = ({ selectedFile, setSelectedFile, onSubmit, - isSubmitting = false }) => { const fileInputRef = useRef(null); const [isHistoryOpen, setIsHistoryOpen] = useState(false); @@ -45,16 +41,6 @@ const TaskSolution: React.FC = ({ }); const solutionHistory = solutionsQuery.data || []; - - const getLatestSolution = () => { - return solutionHistory.length > 0 ? solutionHistory[solutionHistory.length - 1] : null; - }; - - const isOutdatedSolution = () => { - if (!displayedSolution || solutionHistory.length === 0) return false; - const latestSolution = getLatestSolution(); - return latestSolution?.id !== displayedSolution.id; - }; // Set initial solution to the last one (most recent) when solutions are loaded useEffect(() => { @@ -125,19 +111,12 @@ const TaskSolution: React.FC = ({ const handleSolutionSelect = (solution: Solution) => { setDisplayedSolution(solution); + console.log(displayedSolution) }; const handleClearExistingFile = () => { setSelectedSolutionUrl(null); }; - - // Function to switch to the latest solution - const goToLatestSolution = () => { - const latestSolution = getLatestSolution(); - if (latestSolution) { - setDisplayedSolution(latestSolution); - } - }; return (
@@ -149,25 +128,6 @@ const TaskSolution: React.FC = ({
)} - {/* Outdated solution warning */} - {isOutdatedSolution() && ( -
-
- - Устаревшая посылка -
- -
- )} - {task.type === TaskType.INPUT && ( = ({ fileInputRef={fileInputRef} existingFileUrl={selectedSolutionUrl} onClearExistingFile={handleClearExistingFile} - isLoading={isSubmitting} /> )} @@ -204,7 +163,6 @@ const TaskSolution: React.FC = ({ solutions={solutionHistory} maxPoints={task.points} onSolutionSelect={handleSolutionSelect} - currentSolutionId={displayedSolution?.id} /> );