From 710dc3c30da84c9c6992b229576a636b1efa6b79 Mon Sep 17 00:00:00 2001 From: aronmal Date: Wed, 6 Mar 2024 14:05:25 +0100 Subject: [PATCH] Fix: Language navigate replace --- src/routes/[...404].tsx | 4 ++-- src/routes/index.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/routes/[...404].tsx b/src/routes/[...404].tsx index e2fb875..eca610f 100644 --- a/src/routes/[...404].tsx +++ b/src/routes/[...404].tsx @@ -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 ( - + Not Found diff --git a/src/routes/index.tsx b/src/routes/index.tsx index b9e57bf..021570b 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,12 +1,18 @@ import { Title } from "@solidjs/meta"; import { useNavigate } from "@solidjs/router"; +import { HttpStatusCode } from "@solidjs/start"; import { createEffect } from "solid-js"; 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 Language detection...; + return ( + <> + Language detection... + + + ); }