mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 02:20:10 +08:00
fix: timer stop (#5914)
This commit is contained in:
parent
6a48b76c5e
commit
044420dd7e
@ -89,7 +89,8 @@ const ThinkingBlock: React.FC<Props> = ({ block }) => {
|
||||
|
||||
return () => {
|
||||
if (intervalId.current) {
|
||||
window.clearInterval(intervalId.current)
|
||||
clearInterval(intervalId.current)
|
||||
intervalId.current = null
|
||||
}
|
||||
}
|
||||
}, [isThinking])
|
||||
|
||||
@ -348,6 +348,7 @@ const fetchAndProcessAssistantResponseImpl = async (
|
||||
}
|
||||
},
|
||||
onTextComplete: async (finalText) => {
|
||||
cancelThrottledBlockUpdate()
|
||||
if (lastBlockType === MessageBlockType.MAIN_TEXT && lastBlockId) {
|
||||
const changes = {
|
||||
content: finalText,
|
||||
@ -405,6 +406,8 @@ const fetchAndProcessAssistantResponseImpl = async (
|
||||
}
|
||||
},
|
||||
onThinkingComplete: (finalText, final_thinking_millsec) => {
|
||||
cancelThrottledBlockUpdate()
|
||||
|
||||
if (lastBlockType === MessageBlockType.THINKING && lastBlockId) {
|
||||
const changes = {
|
||||
type: MessageBlockType.THINKING,
|
||||
@ -446,6 +449,7 @@ const fetchAndProcessAssistantResponseImpl = async (
|
||||
}
|
||||
},
|
||||
onToolCallComplete: (toolResponse: MCPToolResponse) => {
|
||||
cancelThrottledBlockUpdate()
|
||||
const existingBlockId = toolCallIdToBlockIdMap.get(toolResponse.id)
|
||||
if (toolResponse.status === 'done' || toolResponse.status === 'error') {
|
||||
if (!existingBlockId) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user