From ec9a1cbe31430327f2dda5c904a4f771b07be1d5 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 17 Apr 2025 12:28:24 +0800 Subject: [PATCH] . --- components/utility/home-redirector.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/utility/home-redirector.tsx b/components/utility/home-redirector.tsx index 776d345..90f4cfd 100644 --- a/components/utility/home-redirector.tsx +++ b/components/utility/home-redirector.tsx @@ -1,7 +1,7 @@ 'use client' import { useEffect } from 'react' -import { useRouter } from 'next/navigation' +import { useRouter, usePathname } from 'next/navigation' import i18nConfig from '@/i18nConfig' const isValidLocale = (locale: string): boolean => { @@ -15,7 +15,7 @@ export default function HomeRedirector() { useEffect(() => { if (pathname !== '/') return - + const preferred = localStorage.getItem('preferred-language') const currentPath = window.location.pathname