This commit is contained in:
parent
a6eb3006a1
commit
8653187a04
|
|
@ -39,13 +39,19 @@ export function LanguageSwitcher() {
|
||||||
|
|
||||||
const newPath = '/' + segments.join('/')
|
const newPath = '/' + segments.join('/')
|
||||||
|
|
||||||
startTransition(() => {
|
|
||||||
if (pathname !== newPath) {
|
// 🔥 核心修复:延迟 router.push,确保 cookie 写入完成再跳转
|
||||||
router.push(newPath)
|
setTimeout(() => {
|
||||||
} else {
|
startTransition(() => {
|
||||||
router.refresh()
|
if (pathname !== newPath) {
|
||||||
}
|
router.push(newPath)
|
||||||
})
|
} else {
|
||||||
|
router.refresh()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 0)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue