This commit is contained in:
parent
65c3719707
commit
379313dde9
|
|
@ -22,9 +22,15 @@ import {
|
||||||
validateChatSettings
|
validateChatSettings
|
||||||
} from "../chat-helpers"
|
} from "../chat-helpers"
|
||||||
|
|
||||||
|
import { usePathname } from "next/navigation"
|
||||||
|
|
||||||
export const useChatHandler = () => {
|
export const useChatHandler = () => {
|
||||||
|
const pathname = usePathname() // 获取当前路径
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
// 提取当前路径中的 locale 部分
|
||||||
|
const locale = pathname.split("/")[1] || "en"
|
||||||
|
|
||||||
const {
|
const {
|
||||||
userInput,
|
userInput,
|
||||||
chatFiles,
|
chatFiles,
|
||||||
|
|
@ -175,7 +181,7 @@ export const useChatHandler = () => {
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
return router.push(`/${selectedWorkspace.id}/chat`)
|
return router.push(`/${locale}/${selectedWorkspace.id}/chat`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFocusChatInput = () => {
|
const handleFocusChatInput = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue