Skip to content

Commit

Permalink
Feature 107 adding extra logs and checks (#215)
Browse files Browse the repository at this point in the history
* Adding extra logs and the flushStorageData to see if fixes, or help, with #107

* Adding teh clear appcache storage

* making the clearCache and clearStorage async/await so we can wait for them to finish before loading the app
  • Loading branch information
IsmaelMartinez authored Aug 9, 2019
1 parent b330962 commit 7862b4b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions app/mainAppWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ let aboutBlankRequestCount = 0;

let window = null;

exports.onAppReady = function onAppReady() {
exports.onAppReady = async function onAppReady() {
window = createWindow();
window.webContents.session.clearCache(()=> console.log("session cache cleared"));
window.webContents.session.clearStorageData({ storages: ['appcache']} ,()=> console.log("appcache cleared"));
await clearCache(window.webContents.session);
await clearStorageData(window.webContents.session);

new Menus(window, config, iconPath);

window.on('page-title-updated', (event, title) => {
Expand Down Expand Up @@ -148,3 +149,11 @@ function createWindow() {

return window;
}

const clearCache = (session) => {
new Promise((resolve) => session.clearCache(resolve(console.log("session cache cleared"))));
}

const clearStorageData = (session) => {
new Promise((resolve) => session.clearStorageData({ storages: ['appcache']} , resolve(console.log("appcache cleared")) ));
}

0 comments on commit 7862b4b

Please sign in to comment.