a tool for shared writing and social publishing

Merge pull request #233 from mark-tomlinson-dev/fix/pub-link-permissions

Fix publication link permissions

authored by schlage.town and committed by

GitHub fdf3149b 4effba7b

+7 -1
+7 -1
components/Pages/PublicationMetadata.tsx
··· 13 13 import { useSubscribe } from "src/replicache/useSubscribe"; 14 14 import { useEntitySetContext } from "components/EntitySetProvider"; 15 15 import { timeAgo } from "src/utils/timeAgo"; 16 + import { useIdentityData } from "components/IdentityProvider"; 16 17 export const PublicationMetadata = () => { 17 18 let { rep } = useReplicache(); 18 19 let { data: pub } = useLeafletPublicationData(); 20 + let { identity } = useIdentityData(); 19 21 let title = useSubscribe(rep, (tx) => tx.get<string>("publication_title")); 20 22 let description = useSubscribe(rep, (tx) => 21 23 tx.get<string>("publication_description"), ··· 35 37 <div className={`flex flex-col px-3 sm:px-4 pb-5 sm:pt-3 pt-2`}> 36 38 <div className="flex gap-2"> 37 39 <Link 38 - href={`${getBasePublicationURL(pub.publications)}/dashboard`} 40 + href={ 41 + identity?.atp_did === pub.publications?.identity_did 42 + ? `${getBasePublicationURL(pub.publications)}/dashboard` 43 + : getPublicationURL(pub.publications) 44 + } 39 45 className="leafletMetadata text-accent-contrast font-bold hover:no-underline" 40 46 > 41 47 {pub.publications?.name}