Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
fix(trial): enable visitors and advanced dr analytics
Marc Seitz42cc9da23113
diff --git a/pages/api/teams/[teamId]/viewers/[id]/index.ts b/pages/api/teams/[teamId]/viewers/[id]/index.tsindex bf0b601b..8a46f5ae 100644--- a/pages/api/teams/[teamId]/viewers/[id]/index.ts+++ b/pages/api/teams/[teamId]/viewers/[id]/index.ts@@ -35,10 +35,7 @@ export default async function handle(},});- if (- !team ||- (team.plan.includes("free") && !team.plan.includes("trial"))- ) {+ if (!team || team.plan === "free") {return res.status(404).json({ message: "Team not found" });}diff --git a/pages/api/teams/[teamId]/viewers/index.ts b/pages/api/teams/[teamId]/viewers/index.tsindex c81f5a79..910848b8 100644--- a/pages/api/teams/[teamId]/viewers/index.ts+++ b/pages/api/teams/[teamId]/viewers/index.ts@@ -36,7 +36,7 @@ export default async function handle(},});- if (!team || team.plan.includes("free")) {+ if (!team || team.plan === "free") {return res.status(404).json({ error: "Team not found" });}diff --git a/pages/datarooms/[id]/analytics/index.tsx b/pages/datarooms/[id]/analytics/index.tsxindex ac5b1aa8..590ad146 100644--- a/pages/datarooms/[id]/analytics/index.tsx+++ b/pages/datarooms/[id]/analytics/index.tsx@@ -19,7 +19,7 @@ import DataroomVisitorsTable from "@/components/visitors/dataroom-visitors-tableexport default function DataroomAnalyticsPage() {const { dataroom } = useDataroom();- const { isDatarooms, isDataroomsPlus } = usePlan();+ const { isDatarooms, isDataroomsPlus, isTrial } = usePlan();// State for the selected documentconst [selectedDocument, setSelectedDocument] = useState<{@@ -28,7 +28,8 @@ export default function DataroomAnalyticsPage() {} | null>(null);// Determine default tab based on plan- const defaultTab = isDatarooms || isDataroomsPlus ? "analytics" : "audit-log";+ const defaultTab =+ isTrial || isDatarooms || isDataroomsPlus ? "analytics" : "audit-log";// Check if user has access to analytics featuresconst hasAnalyticsAccess = isDatarooms || isDataroomsPlus;