Skip to content

Commit e442f89

Browse files
committed
fix(FR-1558): Unable to upload multiple files in file explorer (#4408)
resolves #4401 (FR-1558) This PR addresses an issue with file uploads in the `ExplorerActionControls` component by: 1. Adding a check to prevent duplicate file uploads by comparing the current file list with the previously uploaded one 2. Enabling multiple file selection by adding the `multiple` attribute to the Upload component **Checklist:** (if applicable) - [ ] Documentation - [ ] Minium required manager version - [ ] Specific setting for review (eg., KB link, endpoint or how to setup) - [ ] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after
1 parent cb36174 commit e442f89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/backend.ai-ui/src/components/baiClient/FileExplorer/ExplorerActionControls.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ const ExplorerActionControls: React.FC<ExplorerActionControlsProps> = ({
103103
>
104104
<Upload
105105
beforeUpload={(_, fileList) => {
106-
uploadFiles(fileList, onUpload);
106+
if (fileList !== lastFileListRef.current) {
107+
uploadFiles(fileList, onUpload);
108+
}
109+
lastFileListRef.current = fileList;
107110
return false; // Prevent default upload behavior
108111
}}
112+
multiple
109113
showUploadList={false}
110114
>
111115
<Button type="text" icon={<FileAddOutlined />}>

0 commit comments

Comments
 (0)