From a38e4ada05fd52ff86802d8ea3df8b6eb05fe12b Mon Sep 17 00:00:00 2001 From: Junyi Date: Thu, 13 Jun 2024 18:11:39 +0800 Subject: [PATCH] fix(plugin-fm): set invalid when uploading is not completed to avoid submit (#4653) --- .../core/client/src/schema-component/antd/upload/Upload.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/upload/Upload.tsx b/packages/core/client/src/schema-component/antd/upload/Upload.tsx index fd2bc60c55339..65900b724a42e 100644 --- a/packages/core/client/src/schema-component/antd/upload/Upload.tsx +++ b/packages/core/client/src/schema-component/antd/upload/Upload.tsx @@ -345,11 +345,10 @@ export function Uploader({ rules, ...props }: UploadProps) { const beforeUpload = useBeforeUpload(rules); useEffect(() => { - const error = pendingList.find((file) => file.status === 'error'); - if (error) { + if (pendingList.length) { field.setFeedback({ type: 'error', - code: 'UploadError', + code: 'ValidateError', messages: [t('Incomplete uploading files need to be resolved')], }); } else {