a tool for shared writing and social publishing

handle standalone doc comments

+27 -9
+9 -3
app/(home-pages)/notifications/CommentNotication.tsx
··· 27 27 props.commentData.bsky_profiles?.handle || 28 28 "Someone"; 29 29 const pubRecord = props.commentData.documents?.documents_in_publications[0] 30 - ?.publications?.record as PubLeafletPublication.Record; 31 - let rkey = new AtUri(props.commentData.documents?.uri!).rkey; 30 + ?.publications?.record as PubLeafletPublication.Record | undefined; 31 + let docUri = new AtUri(props.commentData.documents?.uri!); 32 + let rkey = docUri.rkey; 33 + let did = docUri.host; 34 + 35 + const href = pubRecord 36 + ? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments` 37 + : `/p/${did}/${rkey}?interactionDrawer=comments`; 32 38 33 39 return ( 34 40 <Notification 35 41 timestamp={props.commentData.indexed_at} 36 - href={`https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`} 42 + href={href} 37 43 icon={<CommentTiny />} 38 44 actionText={<>{displayName} commented on your post</>} 39 45 content={
+9 -3
app/(home-pages)/notifications/MentionNotification.tsx
··· 11 11 const displayName = author.displayName || author.handle || "Someone"; 12 12 const docRecord = props.document.data as PubLeafletDocument.Record; 13 13 const pubRecord = props.document.documents_in_publications[0]?.publications 14 - ?.record as PubLeafletPublication.Record; 15 - const rkey = new AtUri(props.document.uri).rkey; 14 + ?.record as PubLeafletPublication.Record | undefined; 15 + const docUri = new AtUri(props.document.uri); 16 + const rkey = docUri.rkey; 17 + const did = docUri.host; 16 18 const postText = postView.record?.text || ""; 17 19 20 + const href = pubRecord 21 + ? `https://${pubRecord.base_path}/${rkey}` 22 + : `/p/${did}/${rkey}`; 23 + 18 24 return ( 19 25 <Notification 20 26 timestamp={props.created_at} 21 - href={`https://${pubRecord.base_path}/${rkey}`} 27 + href={href} 22 28 icon={<QuoteTiny />} 23 29 actionText={<>{displayName} quoted your post</>} 24 30 content={
+9 -3
app/(home-pages)/notifications/ReplyNotification.tsx
··· 34 34 props.parentData?.bsky_profiles?.handle || 35 35 "Someone"; 36 36 37 - let rkey = new AtUri(props.commentData.documents?.uri!).rkey; 37 + let docUri = new AtUri(props.commentData.documents?.uri!); 38 + let rkey = docUri.rkey; 39 + let did = docUri.host; 38 40 const pubRecord = props.commentData.documents?.documents_in_publications[0] 39 - ?.publications?.record as PubLeafletPublication.Record; 41 + ?.publications?.record as PubLeafletPublication.Record | undefined; 42 + 43 + const href = pubRecord 44 + ? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments` 45 + : `/p/${did}/${rkey}?interactionDrawer=comments`; 40 46 41 47 return ( 42 48 <Notification 43 49 timestamp={props.commentData.indexed_at} 44 - href={`https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`} 50 + href={href} 45 51 icon={<ReplyTiny />} 46 52 actionText={`${displayName} replied to your comment`} 47 53 content={