From b40c29f02e684927d8baaba7041fde24b056a554 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 8 Dec 2021 12:02:58 +0530 Subject: [PATCH] feat: Flush session data only if "Update Chrome" issue occurs --- package.json | 2 +- src/ipcHandlers/main/flushSessionData.js | 8 +++++++- src/preload.js | 3 +-- yarn.lock | 10 +++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 4b64d67a..97034c64 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "altus", "productName": "Altus", - "version": "4.5.3", + "version": "4.5.4", "description": "Desktop client for WhatsApp Web with themes & multiple account support.", "main": "src/index.js", "homepage": "https://gitlab.com/amanharwara/altus", diff --git a/src/ipcHandlers/main/flushSessionData.js b/src/ipcHandlers/main/flushSessionData.js index d76e6837..d5d2af8b 100644 --- a/src/ipcHandlers/main/flushSessionData.js +++ b/src/ipcHandlers/main/flushSessionData.js @@ -2,7 +2,13 @@ const flushSessionData = ({ sender }) => { let session = sender.session; session.flushStorageData(); session.clearStorageData({ - storages: ["appcache", "cachestorage"], + storages: [ + "appcache", + "serviceworkers", + "cachestorage", + "websql", + "indexdb", + ], }); }; diff --git a/src/preload.js b/src/preload.js index d7be0f49..6fbb872b 100644 --- a/src/preload.js +++ b/src/preload.js @@ -12,11 +12,10 @@ let quickRepliesStore = new Store({ defaults: {}, }); -ipcRenderer.send("flush-session-data"); - window.onload = () => { const title_element = document.querySelector(".landing-title"); if (title_element && title_element.innerHTML.includes("Google Chrome")) { + ipcRenderer.send("flush-session-data"); window.location.reload(); } diff --git a/yarn.lock b/yarn.lock index 1a2002c7..fb98bc83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -465,7 +465,7 @@ __metadata: auto-launch: ^5.0.5 concurrently: ^6.2.0 dragula: ^3.7.3 - electron: ^15.0.0 + electron: ^15.3.0 electron-builder: ^22.11.7 electron-context-menu: ^3.1.1 electron-dl: ^3.2.1 @@ -1773,16 +1773,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:^15.0.0": - version: 15.1.1 - resolution: "electron@npm:15.1.1" +"electron@npm:^15.3.0": + version: 15.3.3 + resolution: "electron@npm:15.3.3" dependencies: "@electron/get": ^1.13.0 "@types/node": ^14.6.2 extract-zip: ^1.0.3 bin: electron: cli.js - checksum: be8b977cb611e403185d056d3037e35964b737ba43d34ef5394061516301978150b5f477663ec6023cd74b988a2114c1be283e8b2b00e4fb2b70a5593018b9af + checksum: 5340ca00c9624d5d39dcd3f478b460d970dcf8b2cb351f7d9476cae9ba524bf7c6b5e139c103279cbd70ee924f306f3e0714f0585b25ed9b94ace4066b3a59d9 languageName: node linkType: hard