diff --git a/src/app/site/[site]/layout.tsx b/src/app/site/[site]/layout.tsx index a594509b..a84888a7 100644 --- a/src/app/site/[site]/layout.tsx +++ b/src/app/site/[site]/layout.tsx @@ -13,6 +13,7 @@ import { SiteHeader } from "~/components/site/SiteHeader" import { FABContainer } from "~/components/ui/FAB" import { SITE_URL } from "~/lib/env" import { getSiteLink } from "~/lib/helpers" +import { isInRN } from "~/lib/is-in-rn" import { isOnlyContent, searchParser } from "~/lib/is-only-content" import getQueryClient from "~/lib/query-client" import { ExpandedNote } from "~/lib/types" @@ -93,13 +94,14 @@ export default async function SiteLayout({ }) { const queryClient = getQueryClient() + const { inRN } = isInRN() const search = searchParser() // https://github.com/vercel/next.js/issues/46618#issuecomment-1450416633 // Issue: The type will not be updated when the page is redirected. let pathname = headers().get("x-xlog-pathname") const onlyContent = isOnlyContent() - if (pathname && /^(\/site(?!\/.*\/preview\/).*)/.test(pathname)) { + if (!inRN && pathname && /^(\/site(?!\/.*\/preview\/).*)/.test(pathname)) { const targetPath = `${getSiteLink({ subdomain: params.site, })}/${pathname.replace(/\/site\/(.*)\//, "")}`