Skip to content

Commit 214cb23

Browse files
format all page paths to exclude trailing / (#691)
Co-authored-by: Naomi Trevino <naomi.e.trevino@gmail.com>
1 parent 8df4afc commit 214cb23

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

website/src/renderer/_error.page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ export const Page = () => {
1919

2020
const ClientPage = () => {
2121
const location = useLocation()
22+
const path = location.pathname.endsWith("/")
23+
? location.pathname.slice(0, -1)
24+
: location.pathname
25+
2226
const [{ data, fetching }] = Dailp.usePageByPathQuery({
2327
variables: {
24-
path: location.pathname.endsWith("/")
25-
? location.pathname.slice(0, -1)
26-
: location.pathname,
28+
path: path,
2729
},
2830
requestPolicy: "network-only",
2931
})
3032

3133
if (fetching) {
3234
return null
3335
} else if (data && data.pageByPath) {
34-
return <DailpPageContents path={location.pathname} />
36+
return <DailpPageContents path={path} />
3537
} else {
3638
return <NotFound />
3739
}

0 commit comments

Comments
 (0)