aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-26 11:14:23 +0530
committerLibravatar GitHub <noreply@github.com>2021-09-26 11:14:23 +0530
commit35b31dd0872ed81da7f004138e40b68a4b7e6b51 (patch)
tree6cfcd87ff4f19a1338134977859e3e2d80510084 /src/webview
parentchore: tag the 'recipes' submodule when tagging the main repo - to help ident... (diff)
downloadferdium-app-35b31dd0872ed81da7f004138e40b68a4b7e6b51.tar.gz
ferdium-app-35b31dd0872ed81da7f004138e40b68a4b7e6b51.tar.zst
ferdium-app-35b31dd0872ed81da7f004138e40b68a4b7e6b51.zip
refactor: remove references to 'electron/remote' - part deux (#1987)
Diffstat (limited to 'src/webview')
-rw-r--r--src/webview/lib/RecipeWebview.js4
-rw-r--r--src/webview/sessionHandler.ts13
2 files changed, 2 insertions, 15 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js
index 9c195a9f0..b2a9f3ee8 100644
--- a/src/webview/lib/RecipeWebview.js
+++ b/src/webview/lib/RecipeWebview.js
@@ -126,8 +126,8 @@ class RecipeWebview {
126 } 126 }
127 } 127 }
128 128
129 clearStorageData(storageLocations) { 129 clearStorageData(serviceId, targetsToClear) {
130 this.sessionHandler.clearStorageData(storageLocations); 130 ipcRenderer.send('clear-storage-data', { serviceId, targetsToClear });
131 } 131 }
132 132
133 releaseServiceWorkers() { 133 releaseServiceWorkers() {
diff --git a/src/webview/sessionHandler.ts b/src/webview/sessionHandler.ts
index 4961da12b..0c6d23f23 100644
--- a/src/webview/sessionHandler.ts
+++ b/src/webview/sessionHandler.ts
@@ -1,19 +1,6 @@
1import { getCurrentWebContents } from '@electron/remote';
2
3const debug = require('debug')('Ferdi:Plugin:SessionHandler'); 1const debug = require('debug')('Ferdi:Plugin:SessionHandler');
4 2
5export class SessionHandler { 3export class SessionHandler {
6 clearStorageData(storageLocations: string[]) {
7 try {
8 debug('Clearing storageLocations:', storageLocations);
9 const { session } = getCurrentWebContents();
10 session.flushStorageData();
11 session.clearStorageData({ storages: storageLocations });
12 } catch (error) {
13 debug(error);
14 }
15 }
16
17 async releaseServiceWorkers() { 4 async releaseServiceWorkers() {
18 try { 5 try {
19 const registrations = 6 const registrations =