feat: remove documents limit (#1697)

This commit is contained in:
zxhlyh
2023-12-05 16:53:40 +08:00
committed by GitHub
parent 5789d76582
commit cb3a55dae6
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,