This commit is contained in:
hailin 2025-04-17 12:28:24 +08:00
parent cc5960866e
commit ec9a1cbe31
1 changed files with 2 additions and 2 deletions

View File

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