Fix file deletion bug (#5125)

* Fix for files being deleted when switching modes or closing tasks

* changeset

* Added check to see if we are waiting for API response

* More targetted fix

* Create hot-onions-promise.md

* Delete .changeset/hot-onions-promise.md

---------

Co-authored-by: Kevin Bond <kevin@Kevins-MacBook-Pro.local>
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-07-23 11:44:24 -07:00
1 parent 23fea0e16b
commit 9fad0aa4ae
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Fix for files being deleted when switching modes or closing tasks
+1 -1
View File
@@ -295,7 +295,7 @@ export abstract class DiffViewProvider {
}
async revertChanges(): Promise<void> {
if (!this.absolutePath) {
if (!this.absolutePath || !this.isEditing) {
return
}
const fileExists = this.editType === "modify"