fix: remove window usage in not-found client (#20822)
* remove window usage in not-found client * fix
This commit is contained in:
1 parent
9004dcb93b
commit
02fb7c0ae0
2 files changed
+4
-4
No files matched your search
@@ -22,9 +22,11 @@ export const generateMetadata = async () => {
|
||||
const ServerPage = async () => {
|
||||
const h = await headers();
|
||||
const nonce = h.get("x-nonce") ?? undefined;
|
||||
const host = h.get("x-forwarded-host") ?? "";
|
||||
|
||||
return (
|
||||
<PageWrapper requiresLicense={false} nonce={nonce}>
|
||||
<NotFound />
|
||||
<NotFound host={host} />
|
||||
</PageWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -47,11 +47,9 @@ function getPageInfo(pathname: string, host: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export function NotFound() {
|
||||
export function NotFound({ host }: { host: string }) {
|
||||
const { t } = useLocale();
|
||||
const pathname = usePathname() ?? "";
|
||||
const host = window.location.hostname;
|
||||
|
||||
const { username, pageType, url } = getPageInfo(pathname, host);
|
||||
const isBookingSuccessPage = pathname?.startsWith("/booking");
|
||||
const isSubpage = pathname?.includes("/", 2) || isBookingSuccessPage;
|
||||
|
||||
Reference in new issue
Block a user