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