Skip to content

Commit 4efbb33

Browse files
committed
fix: ensure view is updated when file array is cleared
1 parent d72790b commit 4efbb33

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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)