diff --git a/eslint.config.mjs b/eslint.config.mjs index 6afd37a0f..75d1f22e9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -99,6 +99,7 @@ const jsConfig = defineConfig([ idbAdd: 'readonly', idbCount: 'readonly', idbFolderCleanup: 'readonly', + idbClearAll: 'readonly', idbIsReady: 'readonly', initChangelog: 'readonly', sendNotification: 'readonly', diff --git a/javascript/gallery.js b/javascript/gallery.js index 4bebc3b1a..0054d69e8 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -1027,6 +1027,30 @@ function resetGalleryState(reason) { return controller; } +function clearCacheIfDisabled(browser_cache) { + if (browser_cache === false) { + log('Thumbnail DB cleanup:', 'Image gallery cache setting disabled. Clearing cache.'); + const controller = resetGalleryState('Clearing all thumbnails from cache'); + maintenanceQueue.enqueue({ + signal: controller.signal, + callback: async () => { + const cb_clearMsg = showCleaningMsg(0, true); + await idbClearAll(controller.signal) + .then(() => { + cb_clearMsg(); + currentGalleryFolder = null; + el.clearCacheFolder.innerText = '