mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
file solution fix
This commit is contained in:
+1
-3
@@ -8,7 +8,6 @@ interface FileSolutionProps {
|
|||||||
fileInputRef: React.RefObject<HTMLInputElement>;
|
fileInputRef: React.RefObject<HTMLInputElement>;
|
||||||
existingFileUrl?: string | null;
|
existingFileUrl?: string | null;
|
||||||
onClearExistingFile?: () => void; // New prop to clear existing file URL
|
onClearExistingFile?: () => void; // New prop to clear existing file URL
|
||||||
firstSolution: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FileSolution: React.FC<FileSolutionProps> = ({
|
const FileSolution: React.FC<FileSolutionProps> = ({
|
||||||
@@ -17,7 +16,6 @@ const FileSolution: React.FC<FileSolutionProps> = ({
|
|||||||
fileInputRef,
|
fileInputRef,
|
||||||
existingFileUrl = null,
|
existingFileUrl = null,
|
||||||
onClearExistingFile,
|
onClearExistingFile,
|
||||||
firstSolution
|
|
||||||
}) => {
|
}) => {
|
||||||
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (event.target.files && event.target.files[0]) {
|
if (event.target.files && event.target.files[0]) {
|
||||||
@@ -68,7 +66,7 @@ const FileSolution: React.FC<FileSolutionProps> = ({
|
|||||||
? existingFileUrl.split('/').pop() || 'file'
|
? existingFileUrl.split('/').pop() || 'file'
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
const hasFile = !!selectedFile || (!!existingFileUrl && !firstSolution);
|
const hasFile = !!selectedFile || !!existingFileUrl;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
fileInputRef={fileInputRef}
|
fileInputRef={fileInputRef}
|
||||||
existingFileUrl={selectedSolutionUrl}
|
existingFileUrl={selectedSolutionUrl}
|
||||||
onClearExistingFile={handleClearExistingFile}
|
onClearExistingFile={handleClearExistingFile}
|
||||||
firstSolution={solutionHistory.length > 0}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user