Skip to content

Commit

Permalink
🐛 fix: fix multi file upload dupicate (lobehub#3603)
Browse files Browse the repository at this point in the history
* 🐛 fix: fix upload issue

* 🐛 fix: fix upload issue
  • Loading branch information
arvinxx authored Aug 25, 2024
1 parent 2dd1ae9 commit 60dbed7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/features/FileManager/FileList/EmptyStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const EmptyStatus = ({ showKnowledgeBase, knowledgeBaseId }: EmptyStatusProps) =
</Flexbox>
)}
<Upload
beforeUpload={async (_, fileList) => {
await pushDockFileList(Array.from(fileList), knowledgeBaseId);
beforeUpload={async (file) => {
await pushDockFileList([file], knowledgeBaseId);

return false;
}}
Expand All @@ -122,8 +122,8 @@ const EmptyStatus = ({ showKnowledgeBase, knowledgeBaseId }: EmptyStatusProps) =
</Flexbox>
</Upload>
<Upload
beforeUpload={async (_, fileList) => {
await pushDockFileList(Array.from(fileList), knowledgeBaseId);
beforeUpload={async (file) => {
await pushDockFileList([file], knowledgeBaseId);

return false;
}}
Expand Down
8 changes: 4 additions & 4 deletions src/features/FileManager/Header/UploadFileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const UploadFileButton = ({ knowledgeBaseId }: { knowledgeBaseId?: string }) =>
key: 'upload-file',
label: (
<Upload
beforeUpload={async (_, fileList) => {
await pushDockFileList(Array.from(fileList), knowledgeBaseId);
beforeUpload={async (file) => {
await pushDockFileList([file], knowledgeBaseId);

return false;
}}
Expand All @@ -47,8 +47,8 @@ const UploadFileButton = ({ knowledgeBaseId }: { knowledgeBaseId?: string }) =>
key: 'upload-folder',
label: (
<Upload
beforeUpload={async (_, fileList) => {
await pushDockFileList(Array.from(fileList), knowledgeBaseId);
beforeUpload={async (file) => {
await pushDockFileList([file], knowledgeBaseId);

return false;
}}
Expand Down

0 comments on commit 60dbed7

Please sign in to comment.