Skip to content

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

fix: type error

Marc Seitz4688034da2e8
diff --git a/components/view/viewer/notion-page.tsx b/components/view/viewer/notion-page.tsx
index 6710266e..7e2ebfa1 100644
--- a/components/view/viewer/notion-page.tsx
+++ b/components/view/viewer/notion-page.tsx
@@ -282,8 +282,9 @@ export const NotionPage = ({
setRecordMapState(currentRecordMap);
const firstBlockId = Object.keys(currentRecordMap.block)[0];
const firstBlock = currentRecordMap.block[firstBlockId];
+ const blockValue = firstBlock?.value as Record<string, any>;
setSubTitle(
- firstBlock?.value?.properties?.title?.[0]?.[0] || "Untitled",
+ blockValue?.properties?.title?.[0]?.[0] || "Untitled",
);
window.scrollTo({ top: 0, behavior: "smooth" });
return;
@@ -303,8 +304,9 @@ export const NotionPage = ({
setRecordMapState(newRecordMap);
const firstBlockId = Object.keys(newRecordMap.block)[0];
const firstBlock = newRecordMap.block[firstBlockId];
+ const blockValue = firstBlock?.value as Record<string, any>;
setSubTitle(
- firstBlock?.value?.properties?.title?.[0]?.[0] || "Untitled",
+ blockValue?.properties?.title?.[0]?.[0] || "Untitled",
);
window.scrollTo({ top: 0, behavior: "smooth" });
} catch (error) {
@@ -316,7 +318,8 @@ export const NotionPage = ({
setRecordMapState(recordMap);
const firstBlockId = Object.keys(recordMap.block)[0];
const firstBlock = recordMap.block[firstBlockId];
- setTitle(firstBlock?.value?.properties?.title?.[0]?.[0] || "Untitled");
+ const blockValue = firstBlock?.value as Record<string, any>;
+ setTitle(blockValue?.properties?.title?.[0]?.[0] || "Untitled");
window.scrollTo({ top: 0, behavior: "smooth" });
}
},