Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions components/view/dataroom/dataroom-document-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type DEFAULT_DOCUMENT_VIEW_TYPE = {
isPreview?: boolean;
canDownload?: boolean;
verificationToken?: string;
viewerEmail?: string;
};

export default function DataroomDocumentView({
Expand Down Expand Up @@ -168,17 +169,18 @@ export default function DataroomDocumentView({
useAdvancedExcelViewer,
canDownload,
verificationToken,
viewerEmail,
} = fetchData as DEFAULT_DOCUMENT_VIEW_TYPE;
analytics.identify(
userEmail ?? verifiedEmail ?? data.email ?? undefined,
userEmail ?? viewerEmail ?? verifiedEmail ?? data.email ?? undefined,
);
analytics.capture("Link Viewed", {
linkId: link.id,
documentId: link.dataroomDocument.document.id,
dataroomId: link.dataroomId,
linkType: linkType,
viewerId: viewId,
viewerEmail: data.email ?? verifiedEmail ?? userEmail,
viewerEmail: viewerEmail ?? data.email ?? verifiedEmail ?? userEmail,
isEmbedded,
});

Expand Down Expand Up @@ -206,6 +208,7 @@ export default function DataroomDocumentView({
ipAddress,
useAdvancedExcelViewer,
canDownload,
viewerEmail,
}));
setSubmitted(true);
setVerificationRequested(false);
Expand Down Expand Up @@ -314,8 +317,16 @@ export default function DataroomDocumentView({
brand={brand}
showPoweredByBanner={false}
showAccountCreationSlide={false}
useAdvancedExcelViewer={useAdvancedExcelViewer}
viewerEmail={data.email ?? verifiedEmail ?? userEmail ?? undefined}
useAdvancedExcelViewer={
viewData.useAdvancedExcelViewer ?? useAdvancedExcelViewer
}
viewerEmail={
viewData.viewerEmail ??
data.email ??
verifiedEmail ??
userEmail ??
undefined
}
/>
) : (
<div className="flex h-screen items-center justify-center">
Expand Down
1 change: 1 addition & 0 deletions pages/api/views-dataroom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ export default async function handle(
? "notion"
: undefined,
watermarkConfig: link.enableWatermark ? link.watermarkConfig : undefined,
viewerEmail: viewer?.email ?? email ?? verifiedEmail ?? null,
ipAddress:
link.enableWatermark &&
link.watermarkConfig &&
Expand Down