Explorar el Código

fix: can not find file (#23472)

tags/1.7.2
crazywoola hace 2 meses
padre
commit
8aac402b24
No account linked to committer's email address
Se han modificado 1 ficheros con 2 adiciones y 14 borrados
  1. 2
    14
      web/app/components/base/file-uploader/hooks.ts

+ 2
- 14
web/app/components/base/file-uploader/hooks.ts Ver fichero

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

Cargando…
Cancelar
Guardar