Skip to content

Commit

Permalink
[FIX] wrong file count
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabhg71 committed Oct 20, 2023
1 parent a837bf7 commit 3818fa2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions www/js/lib/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ import cache from './cache.js';
async function updateZimDropdownOptions (fileSystemHandler, selectedFile) {
const select = document.getElementById('zimSelectDropdown');
let options = '';
let count = 0;
if (fileSystemHandler.files.length !== 0) options += '<option value="">Select an archive..</option>';

fileSystemHandler.files.forEach((fileName) => {
if (fileName.endsWith('.zim') || fileName.endsWith('.zimaa')) options += `<option value="${fileName}">${fileName}</option>`;
if (fileName.endsWith('.zim') || fileName.endsWith('.zimaa')) {
options += `<option value="${fileName}">${fileName}</option>`;
count++;
}
});
select.innerHTML = options;
document.getElementById('zimSelectDropdown').value = selectedFile;
document.getElementById('numberOfFilesDisplay').innerText = fileSystemHandler.files.length;
document.getElementById('numberOfFilesDisplay').innerText = count;
}

/**
Expand Down

0 comments on commit 3818fa2

Please sign in to comment.