diff --git a/src/main/index.js b/src/main/index.js index 5697df66..754cdf76 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -327,19 +327,22 @@ function runApp() { }) newWindow.on('close', () => { - newWindow.webContents.session.clearCache() - newWindow.webContents.session.clearStorageData({ - storages: [ - 'appcache', - 'cookies', - 'filesystem', - 'indexdb', - 'shadercache', - 'websql', - 'serviceworkers', - 'cachestorage' - ] - }) + // Clear cache and storage if it's the last window + if (openedWindows.length === 1) { + newWindow.webContents.session.clearCache() + newWindow.webContents.session.clearStorageData({ + storages: [ + 'appcache', + 'cookies', + 'filesystem', + 'indexdb', + 'shadercache', + 'websql', + 'serviceworkers', + 'cachestorage' + ] + }) + } }) newWindow.on('closed', () => {