mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
done
This commit is contained in:
parent
4fdbcb5d78
commit
25d791bc43
1 changed files with 13 additions and 7 deletions
|
|
@ -449,11 +449,14 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
// Reset user response flag for new task
|
||||
userRespondedRef.current = false
|
||||
|
||||
// Clear message queue when starting a new task
|
||||
setMessageQueue([])
|
||||
// Clear retry counts
|
||||
retryCountRef.current.clear()
|
||||
}, [task?.ts])
|
||||
// Preserve the user's queued messages if the active task was canceled.
|
||||
if (!didClickCancel) {
|
||||
// Clear message queue when starting a new task
|
||||
setMessageQueue([])
|
||||
// Clear retry counts
|
||||
retryCountRef.current.clear()
|
||||
}
|
||||
}, [task?.ts, didClickCancel])
|
||||
|
||||
useEffect(() => {
|
||||
if (isHidden) {
|
||||
|
|
@ -636,11 +639,14 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
useEffect(() => {
|
||||
// Early return if conditions aren't met
|
||||
// Also don't process queue if there's an API error (clineAsk === "api_req_failed")
|
||||
// Additionally, DO NOT process queued messages when there is no active task context
|
||||
// (messages.length === 0). This prevents accidentally starting a new task after cancel.
|
||||
if (
|
||||
sendingDisabled ||
|
||||
messageQueue.length === 0 ||
|
||||
isProcessingQueueRef.current ||
|
||||
clineAsk === "api_req_failed"
|
||||
clineAsk === "api_req_failed" ||
|
||||
messages.length === 0
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
|
@ -685,7 +691,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
|||
return () => {
|
||||
isProcessingQueueRef.current = false
|
||||
}
|
||||
}, [sendingDisabled, messageQueue, handleSendMessage, clineAsk])
|
||||
}, [sendingDisabled, messageQueue, handleSendMessage, clineAsk, messages.length])
|
||||
|
||||
const handleSetChatBoxMessage = useCallback(
|
||||
(text: string, images: string[]) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue