chore(git): merge pull request #208 from 184-upload-add into staging
Some checks failed
Release to Staging / build_and_release (push) Has been cancelled
Some checks failed
Release to Staging / build_and_release (push) Has been cancelled
Reviewed-on: #208 Reviewed-by: eugene <eugene@nostrdev.com>
This commit is contained in:
commit
ff875cc9d7
@ -301,7 +301,15 @@ export const CreatePage = () => {
|
||||
|
||||
const handleSelectFiles = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (event.target.files) {
|
||||
setSelectedFiles(Array.from(event.target.files))
|
||||
// Get the uploaded 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)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user