fix: only count something as a directory if it has children (#4595)

* fix: only count something as a directory if it has children

* fix: playwright tests

* fix: return 0 if you cant find the projectfolder

* fix: remove folder count from e2e tests since it is unused currently

---------

Co-authored-by: Tom Pridham <pridham.tom@gmail.com>
This commit is contained in:
Jonathan Tran
2024-12-02 15:16:43 -05:00
committed by GitHub
parent 3cbedcd3e7
commit 51f0b669a4
4 changed files with 28 additions and 9 deletions

View File

@ -307,7 +307,10 @@ const directoryCount = (file: FileEntry) => {
let count = 0
if (file.children) {
for (let entry of file.children) {
count += 1
// We only want to count FileEntries with children, e.g. folders
if (entry.children !== null) {
count += 1
}
directoryCount(entry)
}
}