pluralize folder/file counts correctly in file list summary (#1701)

This commit is contained in:
jpirnay
2026-04-23 09:30:50 +02:00
parent 4981086a1d
commit 8ff8418441
+4 -1
View File
@@ -2257,7 +2257,10 @@
totalSize += file.size;
});
document.getElementById('folder-summary').innerHTML = `${folderCount} folders, ${files.length - folderCount} files, ${formatFileSize(totalSize)}`;
const fileCount = files.length - folderCount;
const folderLabel = folderCount === 1 ? 'folder' : 'folders';
const fileLabel = fileCount === 1 ? 'file' : 'files';
document.getElementById('folder-summary').innerHTML = `${folderCount} ${folderLabel}, ${fileCount} ${fileLabel}, ${formatFileSize(totalSize)}`;
if (files.length === 0) {
fileTable.innerHTML = '<div class="no-files">This folder is empty</div>';