a tool for shared writing and social publishing
0
fork

Configure Feed

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

don't show pub buttons if not publisher

+11 -2
+1
actions/publishToPublication.ts
··· 60 60 .eq("publication", publication_uri) 61 61 .eq("leaflet", leaflet_id) 62 62 .single(); 63 + if (!draft || identity.atp_did !== draft?.publications?.identity_did) return; 63 64 let { data } = await supabaseServerClient.rpc("get_facts", { 64 65 root: root_entity, 65 66 });
+5 -1
app/[leaflet_id]/Footer.tsx
··· 11 11 import { Watermark } from "components/Watermark"; 12 12 import { BackToPubButton, PublishButton } from "./Actions"; 13 13 import { useLeafletPublicationData } from "components/PageSWRDataProvider"; 14 + import { useIdentityData } from "components/IdentityProvider"; 14 15 15 16 export function LeafletFooter(props: { entityID: string }) { 16 17 let focusedBlock = useUIState((s) => s.focusedEntity); 17 18 let entity_set = useEntitySetContext(); 19 + let { identity } = useIdentityData(); 18 20 let { data: publicationData } = useLeafletPublicationData(); 19 21 let pub = publicationData?.[0]; 20 22 ··· 35 37 /> 36 38 </div> 37 39 ) : entity_set.permissions.write ? ( 38 - pub?.publications ? ( 40 + pub?.publications && 41 + identity?.atp_did && 42 + pub.publications.identity_did === identity.atp_did ? ( 39 43 <ActionFooter> 40 44 <BackToPubButton publication={pub.publications} /> 41 45 <PublishButton />
+5 -1
app/[leaflet_id]/Sidebar.tsx
··· 11 11 import { Watermark } from "components/Watermark"; 12 12 import { useUIState } from "src/useUIState"; 13 13 import { BackToPubButton, PublishButton } from "./Actions"; 14 + import { useIdentityData } from "components/IdentityProvider"; 14 15 15 16 export function LeafletSidebar(props: { leaflet_id: string }) { 16 17 let entity_set = useEntitySetContext(); 17 18 let { data: publicationData } = useLeafletPublicationData(); 19 + let { identity } = useIdentityData(); 18 20 let pub = publicationData?.[0]; 19 21 20 22 return ( ··· 31 33 > 32 34 {entity_set.permissions.write && ( 33 35 <Sidebar> 34 - {pub?.publications ? ( 36 + {pub?.publications && 37 + identity?.atp_did && 38 + pub.publications.identity_did === identity.atp_did ? ( 35 39 <> 36 40 <PublishButton /> 37 41 <ShareOptions />