diff --git a/src/page/Datasource/Datasource/NewDatasourceDrawer/Form/SSLItem/SingleUploadFile.tsx b/src/page/Datasource/Datasource/NewDatasourceDrawer/Form/SSLItem/SingleUploadFile.tsx index 60884add3..b5d9eae76 100644 --- a/src/page/Datasource/Datasource/NewDatasourceDrawer/Form/SSLItem/SingleUploadFile.tsx +++ b/src/page/Datasource/Datasource/NewDatasourceDrawer/Form/SSLItem/SingleUploadFile.tsx @@ -38,11 +38,11 @@ const SingleUpload: React.FC = function ({ }) { const [innerFile, _setInnerFile] = useState(null); function setInnerFile(file: UploadFile) { - if (file?.uid !== value) { + _setInnerFile(file); + if (file?.uid !== value && !['error', 'uploading'].includes(file?.status)) { const objectId = file?.response?.data?.contents?.[0]?.objectId; onChange(objectId); } - _setInnerFile(file); } useEffect(() => { if (value) {