diff --git a/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/components/FileSolution/index.tsx b/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/components/FileSolution/index.tsx index 4be1f55..8f97216 100644 --- a/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/components/FileSolution/index.tsx +++ b/services/frontend/src/pages/CompetitionSession/modules/TaskSolution/components/FileSolution/index.tsx @@ -20,7 +20,6 @@ const FileSolution: React.FC = ({ const handleFileChange = (event: React.ChangeEvent) => { if (event.target.files && event.target.files[0]) { setSelectedFile(event.target.files[0]); - // Clear existing file URL when a new file is selected if (existingFileUrl && onClearExistingFile) { onClearExistingFile(); } @@ -47,25 +46,20 @@ const FileSolution: React.FC = ({ if (e.dataTransfer.files && e.dataTransfer.files[0]) { setSelectedFile(e.dataTransfer.files[0]); - // Clear existing file URL when a new file is dropped if (existingFileUrl && onClearExistingFile) { onClearExistingFile(); } } }; - // Handle clearing the file const handleClearFile = () => { setSelectedFile(null); - // Also clear the existing file URL if it exists if (existingFileUrl && onClearExistingFile) { onClearExistingFile(); } }; - // Handle selecting a new file when an existing file is shown const handleSelectNewFile = () => { - // Just trigger the file input click - the actual clearing will happen in handleFileChange fileInputRef.current?.click(); }; @@ -98,7 +92,7 @@ const FileSolution: React.FC = ({ Скачать @@ -108,7 +102,7 @@ const FileSolution: React.FC = ({ {selectedFile ? (