Skip to content

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

fix

Marc Seitz8f40154cfa73
diff --git a/lib/dataroom/index-generator.ts b/lib/dataroom/index-generator.ts
index acc4c84a..88fad177 100644
--- a/lib/dataroom/index-generator.ts
+++ b/lib/dataroom/index-generator.ts
@@ -17,6 +17,7 @@ interface DataroomDocumentWithVersion {
id: string;
folderId: string | null;
orderIndex: number | null;
+ updatedAt: Date;
createdAt: Date;
document: {
id: string;
@@ -147,7 +148,10 @@ export async function generateDataroomIndex(
name: doc.document.name,
type: "File",
path: "/",
- lastUpdated: latestVersion?.updatedAt || new Date(),
+ lastUpdated:
+ doc.updatedAt > latestVersion?.updatedAt
+ ? doc.updatedAt
+ : latestVersion?.updatedAt || new Date(),
createdAt: doc.createdAt,
pages: latestVersion?.numPages ?? 0,
size: formatBytes(latestVersion?.fileSize ?? 0),