This commit is contained in:
hailin 2025-04-17 12:27:20 +08:00
parent bddd42e0db
commit cc5960866e
1 changed files with 3 additions and 0 deletions

View File

@ -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