Skip to content

Commit b222884

Browse files
committed
fix: missing pinned comments in jsonld
1 parent 479c451 commit b222884

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/ui/src/pages/widget/page-url.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function CommentWidgetPage(props: PageCommentProps): JSX.Element {
7878
refetchInterval,
7979
},
8080
);
81-
const { data: pinnedComments } = trpc.comment.pinnedComments.useQuery({
81+
const { data: pinnedComments = [] } = trpc.comment.pinnedComments.useQuery({
8282
url: props.page.url,
8383
});
8484

@@ -93,7 +93,7 @@ export function CommentWidgetPage(props: PageCommentProps): JSX.Element {
9393
'@context': 'https://schema.org',
9494
'@type': 'DiscussionForumPosting',
9595
url: props.page.url,
96-
comment: comments.map((comment: ForestComment) =>
96+
comment: [...comments, ...pinnedComments].map((comment: ForestComment) =>
9797
createCommentJsonLd(comment, props.page.url),
9898
) as Comment[],
9999
};

0 commit comments

Comments
 (0)