fix: can not find file (#23472)

This commit is contained in:
crazywoola
2025-08-05 19:39:19 -07:00
committed by GitHub
parent eb12fd9461
commit 8aac402b24

View File

@@ -68,6 +68,7 @@ export const useFile = (fileConfig: FileUpload) => {
}
return true
}
case SupportUploadFileTypes.custom:
case SupportUploadFileTypes.document: {
if (fileSize > docSizeLimit) {
notify({
@@ -107,19 +108,6 @@ export const useFile = (fileConfig: FileUpload) => {
}
return true
}
case SupportUploadFileTypes.custom: {
if (fileSize > docSizeLimit) {
notify({
type: 'error',
message: t('common.fileUploader.uploadFromComputerLimit', {
type: SupportUploadFileTypes.document,
size: formatFileSize(docSizeLimit),
}),
})
return false
}
return true
}
default: {
return true
}
@@ -231,7 +219,7 @@ export const useFile = (fileConfig: FileUpload) => {
url: res.url,
}
if (!isAllowedFileExtension(res.name, res.mime_type, fileConfig.allowed_file_types || [], fileConfig.allowed_file_extensions || [])) {
notify({ type: 'error', message: `${t('common.fileUploader.fileExtensionNotSupport')} ${file.type}` })
notify({ type: 'error', message: `${t('common.fileUploader.fileExtensionNotSupport')} ${newFile.type}` })
handleRemoveFile(uploadingFile.id)
}
if (!checkSizeLimit(newFile.supportFileType, newFile.size))