Skip to content

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

fix

Marc Seitz211132b0de70
diff --git a/components/billing/add-seat-modal.tsx b/components/billing/add-seat-modal.tsx
index a3514384..4b85506f 100644
--- a/components/billing/add-seat-modal.tsx
+++ b/components/billing/add-seat-modal.tsx
@@ -58,7 +58,7 @@ export function AddSeatModal({
}, [open]);
// Calculate the total number of seats after the update
- const totalSeatsAfterUpdate = limits ? limits.users + quantity : quantity;
+ const totalSeatsAfterUpdate = limits ? limits.users! + quantity : quantity;
const handleDecrement = () => {
if (quantity > 1) {
diff --git a/ee/limits/server.ts b/ee/limits/server.ts
index 7bb2f82a..27d930ad 100644
--- a/ee/limits/server.ts
+++ b/ee/limits/server.ts
@@ -98,6 +98,9 @@ export async function getLimits({
try {
let parsedData = configSchema.parse(team.limits);
+ const basePlan = getBasePlan(team.plan);
+ const defaultLimits = planLimitsMap[basePlan];
+
// Adjust limits based on the plan if they're at the default value
if (isFreePlan(team.plan)) {
return {
@@ -111,6 +114,7 @@ export async function getLimits({
links: parsedData.links === 50 ? Infinity : parsedData.links,
documents:
parsedData.documents === 50 ? Infinity : parsedData.documents,
+ users: parsedData.users || defaultLimits.users,
usage: { documents: documentCount, links: linkCount, users: userCount },
};
}