Skip to content

Commit 98c6f67

Browse files
author
aheizi
committed
fix deleteMultipleTasksWithIds
1 parent 4fa3343 commit 98c6f67

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -977,9 +977,20 @@ export class ClineProvider implements vscode.WebviewViewProvider {
977977
case "deleteMultipleTasksWithIds": {
978978
const ids = message.ids
979979
if (Array.isArray(ids)) {
980-
for (const id of ids) {
981-
await this.deleteTaskWithId(id)
982-
}
980+
const deletePromises = ids.map(async (id) => {
981+
try {
982+
await this.deleteTaskWithId(id)
983+
return { id, success: true }
984+
} catch (error) {
985+
this.outputChannel.appendLine(
986+
`Failed to delete task ${id}: ${error instanceof Error ? error.message : String(error)}`,
987+
)
988+
return { id, success: false }
989+
}
990+
})
991+
992+
await Promise.all(deletePromises)
993+
await this.postStateToWebview()
983994
}
984995
break
985996
}

0 commit comments

Comments
 (0)