feat: remove documents limit (#1697)

This commit is contained in:
zxhlyh 2023-12-05 16:53:40 +08:00 • committed by GitHub
commit cb3a55dae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 4 additions and 42 deletions

View file

@ -18,8 +18,6 @@ type IFileUploaderProps = {
onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void
onFileListUpdate?: (files: FileItem[]) => void
onPreview: (file: File) => void
countLimit: number
countUsed: number
}
const ACCEPTS = [
@ -41,8 +39,6 @@ const FileUploader = ({
onFileUpdate,
onFileListUpdate,
onPreview,
countLimit,
countUsed,
}: IFileUploaderProps) => {
const { t } = useTranslation()
const { notify } = useContext(ToastContext)
@ -149,10 +145,7 @@ const FileUploader = ({
const initialUpload = useCallback((files: File[]) => {
if (!files.length)
return false
if (files.length > countLimit - countUsed) {
notify({ type: 'error', message: t('datasetCreation.stepOne.overCountLimit', { countLimit }) })
return false
}
const preparedFiles = files.map((file, index) => ({
fileID: `file${index}-${Date.now()}`,
file,