file solution fix

This commit is contained in:
rngsurrounded
2025-03-03 23:00:23 +09:00
parent bc0c24fa5a
commit 304704d392
2 changed files with 1 additions and 4 deletions
@@ -8,7 +8,6 @@ interface FileSolutionProps {
fileInputRef: React.RefObject<HTMLInputElement>;
existingFileUrl?: string | null;
onClearExistingFile?: () => void; // New prop to clear existing file URL
firstSolution: boolean
}
const FileSolution: React.FC<FileSolutionProps> = ({
@@ -17,7 +16,6 @@ const FileSolution: React.FC<FileSolutionProps> = ({
fileInputRef,
existingFileUrl = null,
onClearExistingFile,
firstSolution
}) => {
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
if (event.target.files && event.target.files[0]) {
@@ -68,7 +66,7 @@ const FileSolution: React.FC<FileSolutionProps> = ({
? existingFileUrl.split('/').pop() || 'file'
: '';
const hasFile = !!selectedFile || (!!existingFileUrl && !firstSolution);
const hasFile = !!selectedFile || !!existingFileUrl;
return (
<>
@@ -149,7 +149,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
fileInputRef={fileInputRef}
existingFileUrl={selectedSolutionUrl}
onClearExistingFile={handleClearExistingFile}
firstSolution={solutionHistory.length > 0}
/>
)}