Commit 359f311b by Liu

fix:重新分析可点击时机

parent 66fcfcbd
......@@ -338,6 +338,8 @@ export const TacticsChat: React.FC = () => {
}
return newItems
})
// 达到最大轮数时,没有打字效果,需要手动设置 isAsking 为 false
dispatch(setIsAsking(false))
}
/** 提交问题 */
......@@ -451,17 +453,20 @@ export const TacticsChat: React.FC = () => {
// 处理错误
if (msg?.type === 'ERROR') {
// 出错时需要重置 isAsking 状态
dispatch(setIsAsking(false))
// 如果是 AbortError,不显示错误
if (msg.content?.name === 'AbortError') {
return
}
// 其他错误也可以在这里显示错误消息
return
}
// 正常的stream数据
if (msg?.type === 'DATA' && msg?.content?.code === '00000000') {
// eslint-disable-next-line no-console
console.log('[TacticsChat] handleSubmitQuestion:success', msg)
console.log('流式[TacticsChat] handleSubmitQuestion:success', msg)
// eslint-disable-next-line no-console
console.log('[TacticsChat] handleSubmitQuestion:data', msg.content?.data)
handleStreamMesageData(msg, question || '')
......@@ -471,7 +476,6 @@ export const TacticsChat: React.FC = () => {
return
}
if (msg.type === 'END') {
dispatch(setIsAsking(false))
if (isNew) {
setTimeout(() => {
dispatch(fetchTacticsConversations())
......
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