Fix: Language navigate replace
This commit is contained in:
parent
66fa95bb33
commit
fca9a34567
2 changed files with 3 additions and 3 deletions
|
@ -2,13 +2,13 @@ import { Title } from "@solidjs/meta";
|
|||
import { useNavigate } from "@solidjs/router";
|
||||
import { HttpStatusCode } from "@solidjs/start";
|
||||
import Wrapper from "~/components/Wrapper";
|
||||
import Navbar from "~/components/en/Navbar";
|
||||
import Navbar, { lightMode } from "~/components/en/Navbar";
|
||||
import "~/styles/overview.scss";
|
||||
|
||||
export default function NotFound() {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<Wrapper class="overview">
|
||||
<Wrapper class="overview" classList={{ "light-mode": lightMode() }}>
|
||||
<Title>Not Found</Title>
|
||||
<HttpStatusCode code={404} />
|
||||
<Navbar />
|
||||
|
|
|
@ -6,7 +6,7 @@ export default function Home() {
|
|||
const navigate = useNavigate();
|
||||
createEffect(() => {
|
||||
const isGerman = navigator.language.startsWith("de");
|
||||
navigate(isGerman ? "/de" : "/en");
|
||||
navigate(isGerman ? "/de" : "/en", { replace: true });
|
||||
});
|
||||
return <Title>Language detection...</Title>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue