From 35b31dd0872ed81da7f004138e40b68a4b7e6b51 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sun, 26 Sep 2021 11:14:23 +0530 Subject: refactor: remove references to 'electron/remote' - part deux (#1987) --- src/api/server/LocalApi.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/api/server') diff --git a/src/api/server/LocalApi.ts b/src/api/server/LocalApi.ts index 9a6ab2a82..cc7822e78 100644 --- a/src/api/server/LocalApi.ts +++ b/src/api/server/LocalApi.ts @@ -1,5 +1,4 @@ import { ipcRenderer } from 'electron'; -import { session } from '@electron/remote'; import du from 'du'; import { getServicePartitionsDirectory } from '../../helpers/service-helpers'; @@ -41,12 +40,7 @@ export default class LocalApi { } async clearCache(serviceId: string | null = null) { - const s = serviceId - ? session.fromPartition(`persist:service-${serviceId}`) - : session.defaultSession; - - debug('LocalApi::clearCache resolves', serviceId || 'clearAppCache'); - await s.clearStorageData({ + const targetsToClear = { storages: [ 'appcache', 'filesystem', @@ -57,7 +51,8 @@ export default class LocalApi { 'cachestorage', ], quotas: ['temporary', 'persistent', 'syncable'], - }); - return s.clearCache(); + }; + ipcRenderer.send('clear-storage-data', { serviceId, targetsToClear }); + return ipcRenderer.invoke('clear-cache', { serviceId }); } } -- cgit v1.2.3-54-g00ecf