Skip to content

Commit

Permalink
Still trying to only delete one oversized file at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff McMillen authored and Jeff McMillen committed Dec 9, 2024
1 parent df02730 commit a4f11cf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion client/src/components/_common/Form/FileInputDropZone.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function FileInputDropZone({
}
};

const refreshRejectedFiles = () => {
setRejectedFiles(previous => rejectedFiles);
}

const showFileList = (files && files.length > 0) || rejectedFiles.length > 0;

return (
Expand Down Expand Up @@ -77,7 +81,16 @@ function FileInputDropZone({
<Button
type="link"
onClick={() => {
setRejectedFiles([]);
// rejectedFiles.splice(i, 1);
// setRejectedFiles([rejectedFiles]);
// removeRejectedFile(i);
// console.log('click');
// console.log(rejectedFiles[i]);
rejectedFiles.splice(i, 1);
setRejectedFiles(rejectedFiles);
refreshRejectedFiles();
// console.log(rejectedFiles.fileIndex);
// setRejectedFiles([]);
}}
>
Remove
Expand Down

0 comments on commit a4f11cf

Please sign in to comment.