diff --git a/src/components/Folder/index.tsx b/src/components/Folder/index.tsx index 754516f4f..bc426a48e 100644 --- a/src/components/Folder/index.tsx +++ b/src/components/Folder/index.tsx @@ -331,7 +331,7 @@ export default function Folder({ data }: { data?: Agent }) { (item: any) => item.name === chatStoreSelectedFile.name ); console.log("file", file); - if (file) { + if (file && selectedFile?.path !== chatStoreSelectedFile?.path) { selectedFileChange(file as FileInfo, isShowSourceCode); } } @@ -353,7 +353,7 @@ export default function Folder({ data }: { data?: Agent }) { const file = fileGroups[0].files.find( (item: any) => item.path === chatStoreSelectedFile.path ); - if (file) { + if (file && selectedFile?.path !== chatStoreSelectedFile?.path) { selectedFileChange(file as FileInfo, isShowSourceCode); } } @@ -361,7 +361,7 @@ export default function Folder({ data }: { data?: Agent }) { chatStore.tasks[chatStore.activeTaskId as string]?.selectedFile?.path, fileGroups, isShowSourceCode, - chatStore.activeTaskId + chatStore.activeTaskId, ]); const handleBack = () => { @@ -456,7 +456,7 @@ export default function Folder({ data }: { data?: Agent }) { {fileGroups.map((group) => group.files.map((file) => (