a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove logs and fix metadata generation bug!

+3 -6
+3 -6
app/[doc_id]/page.tsx
··· 87 87 .filter((b) => b.type === "text" || b.type === "heading"); 88 88 89 89 let metadata: Metadata = { title: "Untitled Leaflet", description: " " }; 90 - let block = blocks[0]; 91 - console.log(block); 92 - if (!block) return metadata; 90 + let block: undefined | (typeof blocks)[0] = blocks[0]; 93 91 if (block?.type === "heading") { 94 92 let content = initialFacts.find( 95 - (f) => f.entity === block.value && f.attribute === "block/text", 93 + (f) => f.entity === block?.value && f.attribute === "block/text", 96 94 ) as Fact<"block/text"> | undefined; 97 - console.log(content); 98 95 if (content) { 99 96 let doc = new Y.Doc(); 100 97 const update = base64.toByteArray(content.data.value); ··· 104 101 } 105 102 block = blocks[1]; 106 103 } 104 + if (!block) return metadata; 107 105 let content = initialFacts.find( 108 106 (f) => f.entity === block.value && f.attribute === "block/text", 109 107 ) as Fact<"block/text"> | undefined; 110 - console.log(content); 111 108 if (content) { 112 109 let doc = new Y.Doc(); 113 110 const update = base64.toByteArray(content.data.value);