Merge branch 'feat/originui-frontend-integration' of https://git.xueai.art/skills/deerflow2 into feat/originui-frontend-integration
This commit is contained in:
commit
a1929544a6
|
|
@ -93,11 +93,7 @@ export default function ChatPage() {
|
|||
// }
|
||||
return searchParams.get("isnew")?.trim().toLowerCase() === "true";
|
||||
}, [isNewThread, searchParams]);
|
||||
// console.log(createNewSession, "createNewSession");
|
||||
const shouldStayOnNewRoute = useMemo(
|
||||
() => searchParams.get("isnew")?.trim().toLowerCase() === "true",
|
||||
[searchParams],
|
||||
);
|
||||
|
||||
const streamThreadId = useMemo(() => {
|
||||
return isNewThread && createNewSession ? undefined : threadId;
|
||||
}, [createNewSession, isNewThread, threadId]);
|
||||
|
|
@ -110,17 +106,19 @@ export default function ChatPage() {
|
|||
clearSkillError: clearSelectedSkillError,
|
||||
isBootstrapping: isSelectedSkillBootstrapping,
|
||||
} = useSelectedSkillListener({ threadId });
|
||||
// 对话行为控制器
|
||||
const [thread, sendMessage, isUploading] = useThreadStream({
|
||||
threadId: streamThreadId,
|
||||
context: settings.context,
|
||||
createNewSession,
|
||||
isMock,
|
||||
// 发送消息后跳转的逻辑
|
||||
onStart: (currentThreadId) => {
|
||||
setIsNewThread(false);
|
||||
if (!shouldStayOnNewRoute) {
|
||||
// if (!shouldStayOnNewRoute) {
|
||||
// Keep /new in history so router.back() can return to it.
|
||||
router.replace(`/workspace/chats/${currentThreadId}`);
|
||||
}
|
||||
// }
|
||||
// history.pushState(null, "", pathOfThread(currentThreadId));
|
||||
},
|
||||
onFinish: (state) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue