diff --git a/src/app/components/document-upload-dialog.tsx b/src/app/components/document-upload-dialog.tsx index 5fde4b1..e8605ce 100644 --- a/src/app/components/document-upload-dialog.tsx +++ b/src/app/components/document-upload-dialog.tsx @@ -60,18 +60,11 @@ export default function DocumentUploadDialog({ const validateAndSetFile = (file: File) => { const allowedTypes = ['application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'text/plain', 'text/csv', 'text/markdown']; - const maxSize = 10 * 1024 * 1024; // 10MB - if (!allowedTypes.includes(file.type) && !/\.md$/i.test(file.name)) { setUploadError('Invalid file type. Supported: PDF, DOCX, TXT, CSV, MD'); return; } - if (file.size > maxSize) { - setUploadError('File size exceeds 10MB limit'); - return; - } - setUploadError(''); setUploadFiles([file]); }; @@ -343,7 +336,7 @@ export default function DocumentUploadDialog({ or click to browse - Supported: PDF, DOCX, TXT, CSV (Max 50MB) + Supported: PDF, DOCX, TXT, CSV maxSizeBytes) { - return `File size exceeds ${maxFileSize}MB limit`; - } return null; }; @@ -196,7 +189,7 @@ export default function FileAttacher({ // Start upload immediately await uploadFile(file); - }, [maxFileSize, onError]); + }, [onError]); // Keep ref in sync so external drop useEffect can call it handleFileSelectRef.current = handleFileSelect; diff --git a/src/app/components/right-sidebar/use-project-documents.ts b/src/app/components/right-sidebar/use-project-documents.ts index 0ba78a0..6a4fe6e 100644 --- a/src/app/components/right-sidebar/use-project-documents.ts +++ b/src/app/components/right-sidebar/use-project-documents.ts @@ -208,18 +208,11 @@ export function useProjectDocuments({ projectId, folderPath }: UseProjectDocumen const validateFile = (file: File): boolean => { const allowedTypes = ['application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'text/plain', 'text/markdown']; - const maxSize = 50 * 1024 * 1024; // 50MB - if (!allowedTypes.includes(file.type) && !/\.md$/i.test(file.name)) { setUploadError('Invalid file type. Supported: PDF, DOCX, TXT, MD'); return false; } - if (file.size > maxSize) { - setUploadError('File size exceeds 50MB limit'); - return false; - } - return true; };