fix:修复错误跳转无query的场景

This commit is contained in:
肖应宇 2026-04-08 17:21:41 +08:00 committed by Titan
parent 48c48a188e
commit f879e621d6
1 changed files with 7 additions and 7 deletions

View File

@ -59,13 +59,13 @@ export function useIframeSkill(
// }, [searchParams]); // }, [searchParams]);
// 0. 监听 query 中 is_chatting=true 且带 thread_id 时跳转到 thread 页面 // 0. 监听 query 中 is_chatting=true 且带 thread_id 时跳转到 thread 页面
useEffect(() => { // useEffect(() => {
if (!threadId) return; // if (!threadId) return;
if (isChattingFromQuery !== "true") return; // if (isChattingFromQuery !== "true") return;
if (lastThreadIdRef.current === threadId) return; // if (lastThreadIdRef.current === threadId) return;
lastThreadIdRef.current = threadId; // lastThreadIdRef.current = threadId;
router.replace(`/workspace/chats/${threadId}`); // router.replace(`/workspace/chats/${threadId}`);
}, [isChattingFromQuery, router, threadId]); // }, [isChattingFromQuery, router, threadId]);
// 2. 监听宿主页 postMessage // 2. 监听宿主页 postMessage
useEffect(() => { useEffect(() => {