Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix

Marc Seitz8dc0b71cc7c4
diff --git a/components/documents/add-document-modal.tsx b/components/documents/add-document-modal.tsx
index 9e734880..81f13456 100644
--- a/components/documents/add-document-modal.tsx
+++ b/components/documents/add-document-modal.tsx
@@ -261,7 +261,7 @@ export function AddDocumentModal({
): Promise<void> => {
event.preventDefault();
- if (!canUploadDocuments) {
+ if (!canAddDocuments) {
toast.error("You have reached the maximum number of documents.");
return;
}
diff --git a/lib/stripe/webhooks/checkout-session-completed.ts b/lib/stripe/webhooks/checkout-session-completed.ts
index ef41af43..d924a97b 100644
--- a/lib/stripe/webhooks/checkout-session-completed.ts
+++ b/lib/stripe/webhooks/checkout-session-completed.ts
@@ -47,7 +47,10 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
const stripeId = checkoutSession.customer.toString();
const teamId = checkoutSession.client_reference_id;
- let planLimits = structuredClone(PRO_PLAN_LIMITS);
+ let planLimits:
+ | typeof PRO_PLAN_LIMITS
+ | typeof BUSINESS_PLAN_LIMITS
+ | typeof DATAROOMS_PLAN_LIMITS = structuredClone(PRO_PLAN_LIMITS);
if (plan.slug === "pro") {
planLimits = structuredClone(PRO_PLAN_LIMITS);
} else if (plan.slug === "business") {
diff --git a/lib/stripe/webhooks/customer-subscription-updated.ts b/lib/stripe/webhooks/customer-subscription-updated.ts
index 4ce4aa19..fded8c16 100644
--- a/lib/stripe/webhooks/customer-subscription-updated.ts
+++ b/lib/stripe/webhooks/customer-subscription-updated.ts
@@ -54,7 +54,10 @@ export async function customerSubsciptionUpdated(
// If a team upgrades/downgrades their subscription, update their plan
if (team.plan !== newPlan) {
// Choose the correct plan limits
- let planLimits = structuredClone(PRO_PLAN_LIMITS);
+ let planLimits:
+ | typeof PRO_PLAN_LIMITS
+ | typeof BUSINESS_PLAN_LIMITS
+ | typeof DATAROOMS_PLAN_LIMITS = structuredClone(PRO_PLAN_LIMITS);
if (plan.slug === "pro") {
planLimits = structuredClone(PRO_PLAN_LIMITS);
} else if (plan.slug === "business") {
diff --git a/pages/documents/[id]/index.tsx b/pages/documents/[id]/index.tsx
index cdceee95..8524235a 100644
--- a/pages/documents/[id]/index.tsx
+++ b/pages/documents/[id]/index.tsx
@@ -47,7 +47,6 @@ export default function DocumentPage() {
} else {
return (
<Button
- key={"create-link"}
className="flex h-8 whitespace-nowrap text-xs lg:h-9 lg:text-sm"
onClick={() => setIsLinkSheetOpen(true)}
>
@@ -67,7 +66,7 @@ export default function DocumentPage() {
primaryVersion={primaryVersion}
prismaDocument={prismaDocument}
teamId={teamInfo?.currentTeam?.id!}
- actions={[<AddLinkButton />]}
+ actions={[<AddLinkButton key={"create-link"} />]}
/>
{/* <NavMenu