Skip to content

Commit

Permalink
Merge branch 'main' into CHANGELOG-for-v4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid authored Jul 12, 2024
2 parents 09a5b26 + 2802092 commit c53b9ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,10 @@ function initServiceWorkerMessaging () {
action: 'init'
});
} else if (serviceWorkerRegistration) {
// If this is the first time we are initiating the SW, allow Promises to complete by delaying potential reload till next tick
// If this is the first time we are initiating the SW, allow Promises to complete and assets to be fetched by delaying potential reload
console.warn('The Service Worker needs more time to load, or else the app was force-refreshed...');
serviceWorkerRegistration = null;
setTimeout(initServiceWorkerMessaging, 1600);
setTimeout(initServiceWorkerMessaging, 3000);
} else if (params.contentInjectionMode === 'serviceworker') {
console.error('The Service Worker is not controlling the current page! We have to reload.');
// Turn off failsafe, as this is a controlled reboot
Expand All @@ -1010,7 +1010,7 @@ function initServiceWorkerMessaging () {
setTimeout(function () {
params.themeChanged = true;
document.getElementById('btnHome').click();
}, 750);
}, 800);
}
}
});
Expand Down Expand Up @@ -1617,7 +1617,7 @@ function displayFileSelect () {
folderSelect.addEventListener('click', async function (e) {
e.preventDefault();
const previousZimFiles = await abstractFilesystemAccess.selectDirectoryFromPickerViaFileSystemApi()
if (previousZimFiles.length !== 0) setLocalArchiveFromFileList(previousZimFiles);
if (previousZimFiles.length === 1) setLocalArchiveFromFileList(previousZimFiles);
});
}
if (params.isWebkitDirApiSupported) {
Expand Down

0 comments on commit c53b9ce

Please sign in to comment.