diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3c55e187..6984bf17 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,7 +1,10 @@ import { dir } from "i18next" import { Metadata } from "next" +import { headers } from "next/headers" import { Toaster } from "react-hot-toast" +import { updateIndexerFetchOptions } from "@crossbell/indexer" + import "~/css/main.css" import { useAcceptLang } from "~/hooks/useAcceptLang" import { APP_DESCRIPTION, APP_NAME, APP_SLOGAN, SITE_URL } from "~/lib/env" @@ -78,6 +81,11 @@ export default function RootLayout({ const lang = useAcceptLang() const colorScheme = getColorScheme() + // For viewing statistics + updateIndexerFetchOptions({ + headers: headers(), + }) + return ( diff --git a/src/components/common/Comment.tsx b/src/components/common/Comment.tsx index 68ca6e1b..721aa560 100644 --- a/src/components/common/Comment.tsx +++ b/src/components/common/Comment.tsx @@ -7,7 +7,7 @@ import { CommentItem } from "~/components/common/CommentItem" import { useTranslation } from "~/lib/i18n/client" import { ExpandedNote } from "~/lib/types" import { cn } from "~/lib/utils" -import { useGetComments, useGetPage } from "~/queries/page" +import { useGetComments } from "~/queries/page" export const Comment: React.FC<{ page?: ExpandedNote @@ -19,12 +19,6 @@ export const Comment: React.FC<{ }) const { t } = useTranslation("common") - // For viewing statistics - useGetPage({ - characterId: page?.characterId, - noteId: page?.noteId, - }) - const data = comments.data?.pages.filter( (page) => (page?.list?.length ?? 0) > 0, )