Compare commits

..

No commits in common. "ff875cc9d76b953424788e921def74e785680205" and "c2a149c872640343acc7788351b4f231bb4661c3" have entirely different histories.

View File

@ -301,15 +301,7 @@ export const CreatePage = () => {
const handleSelectFiles = (event: React.ChangeEvent<HTMLInputElement>) => { const handleSelectFiles = (event: React.ChangeEvent<HTMLInputElement>) => {
if (event.target.files) { if (event.target.files) {
// Get the uploaded files setSelectedFiles(Array.from(event.target.files))
const files = Array.from(event.target.files)
// Remove duplicates based on the file.name
setSelectedFiles((p) =>
[...p, ...files].filter(
(file, i, array) => i === array.findIndex((t) => t.name === file.name)
)
)
} }
} }