diff --git a/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx b/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx index c5c98b41..72d994a8 100644 --- a/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx +++ b/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx @@ -15,7 +15,6 @@ import Content from './components/content'; import ContentHeader from './components/content-header'; import { getContent } from './components/useContent'; - export async function generateMetadata(): Promise { return _generateMetadata({ title: `Коментарі`, @@ -73,11 +72,12 @@ const CommentsPage: FC = async ({ params }) => { comment_reference && (await queryClient.prefetchQuery({ queryKey: ['commentThread', comment_reference], - queryFn: () => + queryFn: ({ meta }) => getCommentThread({ params: { reference: comment_reference, }, + auth: meta?.auth, }), })); diff --git a/components/comments/components/comment-vote.tsx b/components/comments/components/comment-vote.tsx index 5861b2a2..fe7783f6 100644 --- a/components/comments/components/comment-vote.tsx +++ b/components/comments/components/comment-vote.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import BxBxsDownvote from '~icons/bx/bxs-downvote'; import BxBxsUpvote from '~icons/bx/bxs-upvote'; import BxDownvote from '~icons/bx/downvote'; @@ -24,6 +24,9 @@ const CommentVote: FC = ({ comment }) => { mutationFn: vote, onSuccess: async () => { await queryClient.invalidateQueries({ queryKey: ['comments'] }); + await queryClient.invalidateQueries({ + queryKey: ['commentThread'], + }); }, });