a tool for shared writing and social publishing

fix publication metadata for view only drafts

+8 -3
+8 -3
app/[leaflet_id]/page.tsx
··· 76 76 ); 77 77 let rootEntity = res.data?.root_entity; 78 78 if (!rootEntity || !res.data) return { title: "Leaflet not found" }; 79 - if (res.data.leaflets_in_publications[0]) { 79 + let publication_data = 80 + res.data?.leaflets_in_publications?.[0] || 81 + res.data?.permission_token_rights[0].entity_sets?.permission_tokens?.find( 82 + (p) => p.leaflets_in_publications.length, 83 + )?.leaflets_in_publications?.[0]; 84 + if (publication_data) { 80 85 return { 81 - title: res.data.leaflets_in_publications[0].title || "Untitled", 82 - description: res.data.leaflets_in_publications[0].description, 86 + title: publication_data.title || "Untitled", 87 + description: publication_data.description, 83 88 }; 84 89 } 85 90 let { data } = await supabaseServerClient.rpc("get_facts", {