Fixed double messages after edit

This commit is contained in:
Sannidhya Sah 2025-06-15 17:54:36 +05:30
parent bee50d6bd9
commit 39e790af0f

View file

@ -1132,15 +1132,8 @@ export const webviewMessageHandler = async (
// Force a state update to ensure the webview reflects the changes
await provider.postStateToWebview()
// Auto-resume the task after editing
// Use setTimeout to ensure the task is fully initialized and the ask dialog is ready
setTimeout(async () => {
const currentCline = provider.getCurrentCline()
if (currentCline && currentCline.isInitialized) {
// Simulate clicking "Resume Task" by sending the response directly
currentCline.handleWebviewAskResponse("messageResponse", message.text, message.images)
}
}, 100) // Small delay to ensure proper initialization
// Note: Removed auto-resume logic to prevent duplicate messages.
// The user will manually send the edited message when ready.
}
}
}