From 2f01df3ee3cde555a57277fb56602e21238918b4 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sun, 25 Aug 2024 22:28:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix=20upload=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/FileManager/Header/UploadFileButton.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/features/FileManager/Header/UploadFileButton.tsx b/src/features/FileManager/Header/UploadFileButton.tsx index 4473bb9d15e9..39edff41117c 100644 --- a/src/features/FileManager/Header/UploadFileButton.tsx +++ b/src/features/FileManager/Header/UploadFileButton.tsx @@ -30,8 +30,8 @@ const UploadFileButton = ({ knowledgeBaseId }: { knowledgeBaseId?: string }) => key: 'upload-file', label: ( { - await pushDockFileList(Array.from(fileList), knowledgeBaseId); + beforeUpload={async (file) => { + await pushDockFileList([file], knowledgeBaseId); return false; }} @@ -47,8 +47,8 @@ const UploadFileButton = ({ knowledgeBaseId }: { knowledgeBaseId?: string }) => key: 'upload-folder', label: ( { - await pushDockFileList(Array.from(fileList), knowledgeBaseId); + beforeUpload={async (file) => { + await pushDockFileList([file], knowledgeBaseId); return false; }} From cd944996f36b2e6172f5ba45919d0809e66c685a Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sun, 25 Aug 2024 22:28:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix=20upload=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/FileManager/FileList/EmptyStatus.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/features/FileManager/FileList/EmptyStatus.tsx b/src/features/FileManager/FileList/EmptyStatus.tsx index 01cd7f18a4f3..97fe8ecd7f2f 100644 --- a/src/features/FileManager/FileList/EmptyStatus.tsx +++ b/src/features/FileManager/FileList/EmptyStatus.tsx @@ -102,8 +102,8 @@ const EmptyStatus = ({ showKnowledgeBase, knowledgeBaseId }: EmptyStatusProps) = )} { - await pushDockFileList(Array.from(fileList), knowledgeBaseId); + beforeUpload={async (file) => { + await pushDockFileList([file], knowledgeBaseId); return false; }} @@ -122,8 +122,8 @@ const EmptyStatus = ({ showKnowledgeBase, knowledgeBaseId }: EmptyStatusProps) = { - await pushDockFileList(Array.from(fileList), knowledgeBaseId); + beforeUpload={async (file) => { + await pushDockFileList([file], knowledgeBaseId); return false; }}