Skip to content

Commit 1a034f0

Browse files
Merge pull request #215 from Saifullah-dev/174-fix/file-array-clear-bug
fix: ensure view is updated when files array is cleared
2 parents d72790b + 4efbb33 commit 1a034f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

frontend/src/contexts/FileNavigationContext.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export const FileNavigationProvider = ({ children, initialPath, onFolderChange }
2222
setCurrentFolder(() => {
2323
return files.find((file) => file.path === currentPath) ?? null;
2424
});
25+
} else {
26+
setCurrentPathFiles([]);
27+
setCurrentFolder(null);
2528
}
2629
}, [files, currentPath, sortConfig]);
2730

0 commit comments

Comments
 (0)