add file search and some fixes and bugs

This commit is contained in:
smanylov
2026-01-27 19:52:01 +07:00
parent 1db333a21b
commit 9a6491b76b
14 changed files with 1205 additions and 127 deletions
+9 -2
View File
@@ -234,6 +234,9 @@ export default function UploadSectionFile({ fileType, allowedExtensions, maxFile
const chunkResponse = await chunkUpload(formData);
if (chunkResponse.message_desc !== 'Chunk uploaded successfully') {
if (chunkResponse.message_desc === 'Duplicate file upload') {
throw (`duplicate-file`);
}
throw new Error(`Chunk ${chunkIndex} upload failed`);
}
@@ -251,8 +254,12 @@ export default function UploadSectionFile({ fileType, allowedExtensions, maxFile
} catch (error) {
if (!isCancelledRef.current) {
setError(t('error-uploading-file'));
console.error('Upload error:', error);
if (error === 'duplicate-file') {
setError(t('error-duplicate-file'));
} else {
setError(t('error-uploading-file'));
console.error('Upload error:', error);
}
}
} finally {
setUploadId(null);