From 4d6fca46ad5dbaa860bf2af837c003ec3ff5e6ad Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Wed, 19 Nov 2025 12:27:54 -0500 Subject: [PATCH] add published link for standaloen docs in share menu --- app/[leaflet_id]/actions/ShareOptions/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/[leaflet_id]/actions/ShareOptions/index.tsx b/app/[leaflet_id]/actions/ShareOptions/index.tsx index a87a943f..9b223d44 100644 --- a/app/[leaflet_id]/actions/ShareOptions/index.tsx +++ b/app/[leaflet_id]/actions/ShareOptions/index.tsx @@ -93,10 +93,12 @@ const ShareMenu = (props: { let record = pub?.documents?.data as PubLeafletDocument.Record | null; - let postLink = - pub?.publications && pub.documents - ? `${getPublicationURL(pub.publications)}/${new AtUri(pub?.documents.uri).rkey}` - : null; + let docURI = pub?.documents ? new AtUri(pub?.documents.uri) : null; + let postLink = !docURI + ? null + : pub?.publications + ? `${getPublicationURL(pub.publications)}/${docURI.rkey}` + : `p/${docURI.host}/${docURI.rkey}`; let publishLink = useReadOnlyShareLink(); let [collabLink, setCollabLink] = useState(null); useEffect(() => { -- 2.54.0