|
|
@@ -887,6 +887,24 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|
|
this.askResponse = askResponse
|
|
|
this.askResponseText = text
|
|
|
this.askResponseImages = images
|
|
|
+
|
|
|
+ // Mark the last follow-up question as answered
|
|
|
+ if (askResponse === "messageResponse" || askResponse === "yesButtonClicked") {
|
|
|
+ // Find the last unanswered follow-up message using findLastIndex
|
|
|
+ const lastFollowUpIndex = findLastIndex(
|
|
|
+ this.clineMessages,
|
|
|
+ (msg) => msg.type === "ask" && msg.ask === "followup" && !msg.isAnswered,
|
|
|
+ )
|
|
|
+
|
|
|
+ if (lastFollowUpIndex !== -1) {
|
|
|
+ // Mark this follow-up as answered
|
|
|
+ this.clineMessages[lastFollowUpIndex].isAnswered = true
|
|
|
+ // Save the updated messages
|
|
|
+ this.saveClineMessages().catch((error) => {
|
|
|
+ console.error("Failed to save answered follow-up state:", error)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public approveAsk({ text, images }: { text?: string; images?: string[] } = {}) {
|