Skip to content

Commit

Permalink
Fix error in deletion subroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid committed Oct 31, 2023
1 parent 917f14c commit b27545e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions www/js/lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,12 @@ function deleteOPFSEntry (name) {
return iterateOPFSEntries().then(function (entries) {
var baseName = name.replace(/\.zim[^.]*$/i, '');
entries.forEach(function (entry) {
if (~entry.name.indexOf(baseName)) {
return dirHandle.removeEntry(entry.name).then(function () {
console.log('Deleted ' + entry.name + ' from OPFS');
if (~entry.indexOf(baseName)) {
return dirHandle.removeEntry(entry).then(function () {
console.log('Deleted ' + entry + ' from OPFS');
populateOPFSStorageQuota();
}).catch(function (err) {
console.error('Unable to delete ' + entry.name + ' from OPFS', err);
console.error('Unable to delete ' + entry + ' from OPFS', err);
});
}
});
Expand Down

0 comments on commit b27545e

Please sign in to comment.