Skip to content

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

update

Ashish Viradiya93f57e7f26ec
diff --git a/components/view/viewer/dataroom-viewer.tsx b/components/view/viewer/dataroom-viewer.tsx
index 8e4d1bb2..1514e8a2 100644
--- a/components/view/viewer/dataroom-viewer.tsx
+++ b/components/view/viewer/dataroom-viewer.tsx
@@ -143,13 +143,13 @@ export default function DataroomViewer({
(doc) => doc.folderId === folder.id,
);
- const lastUpdatedDocument = folderDocuments.reduce(
- (latest, doc) => {
+ const lastUpdatedDocument = folderDocuments.reduce((latest, doc) => {
+ if (doc.versions && doc.versions.length > 0) {
const docDate = new Date(doc.versions[0].updatedAt);
return docDate > latest ? docDate : latest;
- },
- new Date(0),
- );
+ }
+ return latest;
+ }, new Date(0));
const folderUpdatedAt = new Date(folder.updatedAt);
const effectiveUpdatedAt =