Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix (#3694)

sp.wack7df3ca4ac80d
diff --git a/frontend/src/components/file-explorer/TreeNode.tsx b/frontend/src/components/file-explorer/TreeNode.tsx
index 52c18a7169..33e6307834 100644
--- a/frontend/src/components/file-explorer/TreeNode.tsx
+++ b/frontend/src/components/file-explorer/TreeNode.tsx
@@ -79,12 +79,10 @@ function TreeNode({ path, defaultOpen = false }: TreeNodeProps) {
setIsOpen((prev) => !prev);
} else {
let newFileState = fileStates.find((f) => f.path === path);
- if (!newFileState) {
- const code = await selectFile(path);
- newFileState = { path, savedContent: code, unsavedContent: code };
- }
+ const code = await selectFile(path);
+ newFileState = { path, savedContent: code, unsavedContent: code };
dispatch(addOrUpdateFileState(newFileState));
- dispatch(setCode(newFileState.unsavedContent));
+ dispatch(setCode(code));
dispatch(setActiveFilepath(path));
}
};