From 9e5842183d7c2db269cc698d4188dbe7f61f5597 Mon Sep 17 00:00:00 2001 From: Aziz Chebbi <60013060+azizChebbi@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:52:18 +0100 Subject: [PATCH] fix: we can't upload the same file twice in the FileUploader component (#14667) --- packages/react/src/components/FileUploader/FileUploader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/FileUploader/FileUploader.tsx b/packages/react/src/components/FileUploader/FileUploader.tsx index 179605f8a3d1..072c7c34940e 100644 --- a/packages/react/src/components/FileUploader/FileUploader.tsx +++ b/packages/react/src/components/FileUploader/FileUploader.tsx @@ -230,7 +230,7 @@ export default class FileUploader extends React.Component< ) as string[]; this.setState({ filenames: this.props.multiple - ? this.state.filenames.concat(filenames) + ? [...new Set([...this.state.filenames, ...filenames])] : filenames, }); if (this.props.onChange) {