aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
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/api
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/api')
-rw-r--r--src/api/server/LocalApi.ts13
1 files changed, 4 insertions, 9 deletions
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 @@
1import { ipcRenderer } from 'electron'; 1import { ipcRenderer } from 'electron';
2import { session } from '@electron/remote';
3import du from 'du'; 2import du from 'du';
4 3
5import { getServicePartitionsDirectory } from '../../helpers/service-helpers'; 4import { getServicePartitionsDirectory } from '../../helpers/service-helpers';
@@ -41,12 +40,7 @@ export default class LocalApi {
41 } 40 }
42 41
43 async clearCache(serviceId: string | null = null) { 42 async clearCache(serviceId: string | null = null) {
44 const s = serviceId 43 const targetsToClear = {
45 ? session.fromPartition(`persist:service-${serviceId}`)
46 : session.defaultSession;
47
48 debug('LocalApi::clearCache resolves', serviceId || 'clearAppCache');
49 await s.clearStorageData({
50 storages: [ 44 storages: [
51 'appcache', 45 'appcache',
52 'filesystem', 46 'filesystem',
@@ -57,7 +51,8 @@ export default class LocalApi {
57 'cachestorage', 51 'cachestorage',
58 ], 52 ],
59 quotas: ['temporary', 'persistent', 'syncable'], 53 quotas: ['temporary', 'persistent', 'syncable'],
60 }); 54 };
61 return s.clearCache(); 55 ipcRenderer.send('clear-storage-data', { serviceId, targetsToClear });
56 return ipcRenderer.invoke('clear-cache', { serviceId });
62 } 57 }
63} 58}