web/error: redirect to default about page on 404 error

This commit is contained in:
wukko 2024-09-04 21:23:47 +06:00
parent 201f9aaefe
commit 41c23337ff
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -8,6 +8,8 @@
if ($page.error?.message === "Not Found") {
if ($page.url.pathname.startsWith("/settings")) {
goto(defaultNavPage("settings"), { replaceState: true });
} else if ($page.url.pathname.startsWith("/about")) {
goto(defaultNavPage("about"), { replaceState: true });
} else {
goto("/", { replaceState: true });
}