diff --git a/package.json b/package.json index 5314cfb..634d507 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "no-copy-frontend", - "version": "0.38.0", + "version": "0.39.0", "private": true, "scripts": { "dev": "next dev -p 2999", diff --git a/src/app/components/UploadSectionFile.tsx b/src/app/components/UploadSectionFile.tsx index c6cbaae..ec2f3ff 100644 --- a/src/app/components/UploadSectionFile.tsx +++ b/src/app/components/UploadSectionFile.tsx @@ -6,7 +6,6 @@ import { fileUpload, cancelUpload, chunkUpload, checkChunkStatus } from '@/app/a import { useTranslations } from 'next-intl'; import { useNavigationBlocker } from '@/app/hooks/useNavigationBlocker'; import { useQueryClient } from '@tanstack/react-query'; -import { resolve } from 'path'; interface SelectedFile { file: File; @@ -128,8 +127,8 @@ export default function UploadSectionFile({ if (fileType === "image") { try { dimensions = await getImageDimensions(file) as { width: number, height: number }; - if (dimensions.width < 100 || dimensions.height < 100 || - dimensions.width > 10000 || dimensions.height > 10000) { + if (dimensions?.width < 100 || dimensions?.height < 100 || + dimensions?.width > 10000 || dimensions?.height > 10000) { setError(prev => prev ? `${prev}, ${t('image-size')}: ${dimensions?.width}x${dimensions?.height}. ${t('acceptable-range')}: 100x100 - 10000x10000 ${t('pixels')}.` : `${t('image-size')}: ${dimensions?.width}x${dimensions?.height}. ${t('acceptable-range')}: 100x100 - 10000x10000 ${t('pixels')}.`); continue; @@ -184,7 +183,6 @@ export default function UploadSectionFile({ const handleClearFile = async (fileId?: string): Promise => { if (fileId) { - // Очистка конкретного файла const fileToClear = selectedFiles.find(f => f.uploadId === fileId || f.name === fileId); if (fileToClear?.preview) { URL.revokeObjectURL(fileToClear.preview); @@ -204,14 +202,12 @@ export default function UploadSectionFile({ f.uploadId !== fileId && f.name !== fileId )); } else { - // Очистка всех файлов selectedFiles.forEach(file => { if (file.preview) { URL.revokeObjectURL(file.preview); } }); - // Отмена всех активных загрузок const cancelPromises = Array.from(activeUploads).map(uploadId => cancelUpload(uploadId) ); @@ -319,14 +315,6 @@ export default function UploadSectionFile({ f.name === fileInfo.name ? { ...f, status: 'error', error: errorMessage } : f )); } - } finally { - /* if (fileInfo.uploadId) { - setActiveUploads(prev => { - const newSet = new Set(prev); - newSet.delete(fileInfo.uploadId!); - return newSet; - }); - } */ } }; @@ -341,9 +329,6 @@ export default function UploadSectionFile({ if (batch.length === 0) return; - console.log('Текущие pending файлы:', currentPending); - console.log('Загружаемая партия:', batch); - await Promise.all(batch.map(file => uploadSingleFile(file))); if (selectedFilesRef.current.some(f => f.status === 'pending')) { diff --git a/src/app/styles/global-styles.scss b/src/app/styles/global-styles.scss index 75f973b..4dd2171 100644 --- a/src/app/styles/global-styles.scss +++ b/src/app/styles/global-styles.scss @@ -309,8 +309,6 @@ .build-versions { position: absolute; -/* margin-top: 20px; - margin-left: 5px; */ bottom: 10px; left: 10px; color: #fffc;