Commit 3c4efd49 by Liu

fix: 返回时常见问题触发时机

parent f5f96faf
...@@ -304,12 +304,15 @@ export const Chat: React.FC = () => { ...@@ -304,12 +304,15 @@ export const Chat: React.FC = () => {
const eventToolId = toolId || currentToolId || safeSessionStorageGetItem('currentToolId') || '' const eventToolId = toolId || currentToolId || safeSessionStorageGetItem('currentToolId') || ''
console.log('[Chat] 检测到从收藏页返回 (fromCollect=true) - 准备触发 refreshQuestionsFromCollect 事件') console.log('[Chat] 检测到从收藏页返回 (fromCollect=true) - 准备触发 refreshQuestionsFromCollect 事件')
console.log('[Chat] refreshQuestionsFromCollect - 传递的 toolId:', eventToolId) console.log('[Chat] refreshQuestionsFromCollect - 传递的 toolId:', eventToolId)
// 延迟触发事件,确保 Home 组件的监听器已注册
setTimeout(() => {
window.dispatchEvent(new CustomEvent('refreshQuestionsFromCollect', { window.dispatchEvent(new CustomEvent('refreshQuestionsFromCollect', {
detail: { detail: {
toolId: eventToolId, toolId: eventToolId,
}, },
})) }))
console.log('[Chat] refreshQuestionsFromCollect 事件已触发') console.log('[Chat] refreshQuestionsFromCollect 事件已触发')
}, 100)
} }
const res = await fetchUserQaRecordPage(conversationId, toolId || '') const res = await fetchUserQaRecordPage(conversationId, toolId || '')
console.log('qaRes chatEditor2222222', res) console.log('qaRes chatEditor2222222', res)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment