Fix vscode returning invalid array object for history state on certain devices

This commit is contained in:
Saoud Rizwan
2024-08-17 11:24:08 -04:00
parent 26fb2780b5
commit 4f00f89bf3
4 changed files with 186 additions and 172 deletions

View File

@@ -447,7 +447,7 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider {
customInstructions,
themeName: vscode.workspace.getConfiguration("workbench").get<string>("colorTheme"),
claudeMessages: this.claudeDev?.claudeMessages || [],
taskHistory: (taskHistory || []).sort((a, b) => b.ts - a.ts),
taskHistory: (taskHistory || []).filter((item) => item.ts && item.task).sort((a, b) => b.ts - a.ts),
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
},
})