Merge remote-tracking branch 'origin/main' into dev

This commit is contained in:
DIYgod 2023-08-25 15:01:37 +01:00
commit 32a3aee50d
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -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\/(.*)\//, "")}`