fix(plugin-fm): set invalid when uploading is not completed to avoid submit (#4653)

This commit is contained in:
Junyi 2024-06-13 18:11:39 +08:00 committed by GitHub
parent 1d568c635e
commit a38e4ada05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {