浏览代码

fix: 'next' button unresponsive when uploading additional documents before previous batch completes (#2991)

tags/0.5.11
Ricky 1年前
父节点
当前提交
714722bb2d
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4
    5
      web/app/components/datasets/create/file-uploader/index.tsx

+ 4
- 5
web/app/components/datasets/create/file-uploader/index.tsx 查看文件

@@ -130,7 +130,6 @@ const FileUploader = ({
}
}

const fileListCopy = fileListRef.current
return upload({
xhr: new XMLHttpRequest(),
data: formData,
@@ -142,14 +141,14 @@ const FileUploader = ({
file: res,
progress: -1,
}
const index = fileListCopy.findIndex(item => item.fileID === fileItem.fileID)
fileListCopy[index] = completeFile
onFileUpdate(completeFile, 100, fileListCopy)
const index = fileListRef.current.findIndex(item => item.fileID === fileItem.fileID)
fileListRef.current[index] = completeFile
onFileUpdate(completeFile, 100, fileListRef.current)
return Promise.resolve({ ...completeFile })
})
.catch((e) => {
notify({ type: 'error', message: e?.response?.code === 'forbidden' ? e?.response?.message : t('datasetCreation.stepOne.uploader.failed') })
onFileUpdate(fileItem, -2, fileListCopy)
onFileUpdate(fileItem, -2, fileListRef.current)
return Promise.resolve({ ...fileItem })
})
.finally()

正在加载...
取消
保存