mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: reset cancel button state when streaming ends or task changes
- Reset didClickCancel flag when streaming transitions from active to inactive - Reset didClickCancel flag when switching between tasks - Reset didClickCancel flag during chat reset operations - Fixes issue where cancel button remained inactive after clicking cancel Fixes #9303
This commit is contained in:
parent
7a06902dd8
commit
87044dde24
1 changed files with 7 additions and 0 deletions
|
|
@ -414,6 +414,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
everVisibleMessagesTsRef.current.clear() // Clear for new task
|
||||
setCurrentFollowUpTs(null) // Clear follow-up answered state for new task
|
||||
setIsCondensing(false) // Reset condensing state when switching tasks
|
||||
setDidClickCancel(false) // Reset cancel button state when switching tasks
|
||||
// Note: sendingDisabled is not reset here as it's managed by message effects
|
||||
|
||||
// Clear any pending auto-approval timeout from previous task
|
||||
|
|
@ -524,6 +525,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
setSelectedImages([])
|
||||
setClineAsk(undefined)
|
||||
setEnableButtons(false)
|
||||
setDidClickCancel(false) // Reset cancel button state when chat resets
|
||||
// Do not reset mode here as it should persist.
|
||||
// setPrimaryButtonText(undefined)
|
||||
// setSecondaryButtonText(undefined)
|
||||
|
|
@ -961,6 +963,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
}
|
||||
}
|
||||
|
||||
// Reset didClickCancel when streaming ends
|
||||
if (wasStreaming && !isStreaming) {
|
||||
setDidClickCancel(false)
|
||||
}
|
||||
|
||||
// Update previous value.
|
||||
setWasStreaming(isStreaming)
|
||||
}, [isStreaming, lastMessage, wasStreaming, messages.length])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue