Skip to content

Commit

Permalink
fix pathname was always _not-found in 404 page (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina authored Mar 28, 2024
1 parent 874f8b4 commit 9ed23a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
"use client"

import { usePathname } from "next/navigation"
import { useMounted } from "nextra/hooks"

export default function Page() {
const pathname = usePathname()?.replace(/\/$/, "")
const pathname = usePathname()
const mounted = useMounted()

const repo = {
origin: "https://github.com",
owner: "graphql",
name: "graphql.github.io",
}

const title = `Found broken \`${pathname}\` link. Please fix!`
const title = `Found broken \`${mounted ? pathname?.replace(/\/$/, "") : ""}\` link. Please fix!`
const labels = "bug"

const url = `${repo.origin}/${repo.owner}/${
Expand Down

0 comments on commit 9ed23a4

Please sign in to comment.