Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: increase file size limit on pro and higher
Marc Seitz6dbdf23e2c13
diff --git a/components/document-upload.tsx b/components/document-upload.tsxindex 3b05c6fe..d5a63079 100644--- a/components/document-upload.tsx+++ b/components/document-upload.tsx@@ -33,8 +33,8 @@ export default function DocumentUpload({const { plan, trial } = usePlan();const isFreePlan = plan === "free";const isTrial = !!trial;- const maxSize = plan === "business" || plan === "datarooms" ? 100 : 30;- const maxNumPages = plan === "business" || plan === "datarooms" ? 500 : 100;+ const maxSize = isFreePlan && !isTrial ? 30 : 100;+ const maxNumPages = isFreePlan && !isTrial ? 100 : 500;const { getRootProps, getInputProps } = useDropzone({accept:diff --git a/components/upload-zone.tsx b/components/upload-zone.tsxindex 27a8ad4a..c3ed499e 100644--- a/components/upload-zone.tsx+++ b/components/upload-zone.tsx@@ -105,8 +105,8 @@ export default function UploadZone({const { data: session } = useSession();const isFreePlan = plan === "free";const isTrial = !!trial;- const maxSize = plan === "business" || plan === "datarooms" ? 250 : 30;- const maxNumPages = plan === "business" || plan === "datarooms" ? 500 : 100;+ const maxSize = isFreePlan && !isTrial ? 30 : 250;+ const maxNumPages = isFreePlan && !isTrial ? 100 : 500;const { limits, canAddDocuments } = useLimits();const remainingDocuments = limits?.documents? limits?.documents - limits?.usage?.documents@@ -131,7 +131,7 @@ export default function UploadZone({const rejected = rejectedFiles.map(({ file, errors }) => {let message = "";if (errors.find(({ code }) => code === "file-too-large")) {- message = `File size too big (max. ${maxSize} MB)`;+ message = `File size too big (max. ${maxSize} MB). Upgrade to a paid plan to increase the limit.`;} else if (errors.find(({ code }) => code === "file-invalid-type")) {const isSupported = SUPPORTED_DOCUMENT_MIME_TYPES.includes(file.type);message = `File type not supported ${