a tool for shared writing and social publishing

fix metadata on read links

+8 -4
+1 -1
app/api/rpc/[command]/get_leaflet_data.ts
··· 19 19 .from("permission_tokens") 20 20 .select( 21 21 `*, 22 - permission_token_rights(*, entity_sets(permission_tokens(${leaflets_in_publications_query}))), 22 + permission_token_rights(*, entity_sets(permission_tokens(${leaflets_in_publications_query}, ${leaflets_to_documents_query}))), 23 23 custom_domain_routes!custom_domain_routes_edit_permission_token_fkey(*), 24 24 ${leaflets_in_publications_query}, 25 25 ${leaflets_to_documents_query}`,
+6 -2
components/PageSWRDataProvider.tsx
··· 75 75 )?.leaflets_in_publications?.[0]; 76 76 77 77 // If not found, check for standalone documents 78 - if (!pubData && data?.leaflets_to_documents?.[0]) { 78 + let standaloneDoc = 79 + data?.leaflets_to_documents?.[0] || 80 + data?.permission_token_rights[0].entity_sets?.permission_tokens.find( 81 + (p) => p.leaflets_to_documents.length, 82 + )?.leaflets_to_documents?.[0]; 83 + if (!pubData && standaloneDoc) { 79 84 // Transform standalone document data to match the expected format 80 - let standaloneDoc = data.leaflets_to_documents[0]; 81 85 pubData = { 82 86 ...standaloneDoc, 83 87 publications: null, // No publication for standalone docs
+1 -1
components/Pages/PublicationMetadata.tsx
··· 86 86 href={ 87 87 pub.publications 88 88 ? `${getPublicationURL(pub.publications)}/${new AtUri(pub.doc).rkey}` 89 - : `/p/${identity?.atp_did}/${new AtUri(pub.doc).rkey}` 89 + : `/p/${new AtUri(pub.doc).host}/${new AtUri(pub.doc).rkey}` 90 90 } 91 91 > 92 92 View Post