From 833eeb067135fb6d0ac66bd2a98f2af37c60f6a8 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Wed, 26 Nov 2025 15:58:54 -0500 Subject: [PATCH] handle standalone doc comments --- app/(home-pages)/notifications/CommentNotication.tsx | 12 +++++++++--- .../notifications/MentionNotification.tsx | 12 +++++++++--- app/(home-pages)/notifications/ReplyNotification.tsx | 12 +++++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/(home-pages)/notifications/CommentNotication.tsx b/app/(home-pages)/notifications/CommentNotication.tsx index f8a68def..b40c8b03 100644 --- a/app/(home-pages)/notifications/CommentNotication.tsx +++ b/app/(home-pages)/notifications/CommentNotication.tsx @@ -27,13 +27,19 @@ export const CommentNotification = (props: HydratedCommentNotification) => { props.commentData.bsky_profiles?.handle || "Someone"; const pubRecord = props.commentData.documents?.documents_in_publications[0] - ?.publications?.record as PubLeafletPublication.Record; - let rkey = new AtUri(props.commentData.documents?.uri!).rkey; + ?.publications?.record as PubLeafletPublication.Record | undefined; + let docUri = new AtUri(props.commentData.documents?.uri!); + let rkey = docUri.rkey; + let did = docUri.host; + + const href = pubRecord + ? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments` + : `/p/${did}/${rkey}?interactionDrawer=comments`; return ( } actionText={<>{displayName} commented on your post} content={ diff --git a/app/(home-pages)/notifications/MentionNotification.tsx b/app/(home-pages)/notifications/MentionNotification.tsx index a50304d8..94c283b6 100644 --- a/app/(home-pages)/notifications/MentionNotification.tsx +++ b/app/(home-pages)/notifications/MentionNotification.tsx @@ -11,14 +11,20 @@ export const QuoteNotification = (props: HydratedQuoteNotification) => { const displayName = author.displayName || author.handle || "Someone"; const docRecord = props.document.data as PubLeafletDocument.Record; const pubRecord = props.document.documents_in_publications[0]?.publications - ?.record as PubLeafletPublication.Record; - const rkey = new AtUri(props.document.uri).rkey; + ?.record as PubLeafletPublication.Record | undefined; + const docUri = new AtUri(props.document.uri); + const rkey = docUri.rkey; + const did = docUri.host; const postText = postView.record?.text || ""; + const href = pubRecord + ? `https://${pubRecord.base_path}/${rkey}` + : `/p/${did}/${rkey}`; + return ( } actionText={<>{displayName} quoted your post} content={ diff --git a/app/(home-pages)/notifications/ReplyNotification.tsx b/app/(home-pages)/notifications/ReplyNotification.tsx index 10aa4703..56fc2447 100644 --- a/app/(home-pages)/notifications/ReplyNotification.tsx +++ b/app/(home-pages)/notifications/ReplyNotification.tsx @@ -34,14 +34,20 @@ export const ReplyNotification = (props: HydratedCommentNotification) => { props.parentData?.bsky_profiles?.handle || "Someone"; - let rkey = new AtUri(props.commentData.documents?.uri!).rkey; + let docUri = new AtUri(props.commentData.documents?.uri!); + let rkey = docUri.rkey; + let did = docUri.host; const pubRecord = props.commentData.documents?.documents_in_publications[0] - ?.publications?.record as PubLeafletPublication.Record; + ?.publications?.record as PubLeafletPublication.Record | undefined; + + const href = pubRecord + ? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments` + : `/p/${did}/${rkey}?interactionDrawer=comments`; return ( } actionText={`${displayName} replied to your comment`} content={ -- 2.51.2