From cc5960866ea3699ee8abc9017ebe1337bd2ca9e4 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 17 Apr 2025 12:27:20 +0800 Subject: [PATCH] . --- components/utility/home-redirector.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/utility/home-redirector.tsx b/components/utility/home-redirector.tsx index 41fe1b8..776d345 100644 --- a/components/utility/home-redirector.tsx +++ b/components/utility/home-redirector.tsx @@ -11,8 +11,11 @@ const isValidLocale = (locale: string): boolean => { export default function HomeRedirector() { const router = useRouter() + const pathname = usePathname() useEffect(() => { + if (pathname !== '/') return + const preferred = localStorage.getItem('preferred-language') const currentPath = window.location.pathname