Skip to content

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

fix

Marc Seitz751821a4a911
diff --git a/pages/api/analytics/index.ts b/pages/api/analytics/index.ts
index 0f9d0ec6..c7915275 100644
--- a/pages/api/analytics/index.ts
+++ b/pages/api/analytics/index.ts
@@ -472,13 +472,13 @@ export default async function handler(
},
});
- // Count hidden views from pause
+ // Count hidden views from pause (clamp pauseStartsAt to startDate if it's earlier)
const hiddenFromPause = pauseStartsAt
? await prisma.view.count({
where: {
teamId,
viewedAt: {
- gte: pauseStartsAt,
+ gte: pauseStartsAt < startDate ? startDate : pauseStartsAt,
lte: endDate,
},
isArchived: false,
@@ -585,13 +585,13 @@ export default async function handler(
},
});
- // Count hidden views from pause
+ // Count hidden views from pause (clamp pauseStartsAt to startDate if it's earlier)
const hiddenFromPause = pauseStartsAt
? await prisma.view.count({
where: {
teamId,
viewedAt: {
- gte: pauseStartsAt,
+ gte: pauseStartsAt < startDate ? startDate : pauseStartsAt,
lte: endDate,
},
isArchived: false,