diff options
author | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2021-09-26 11:14:23 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 11:14:23 +0530 |
commit | 35b31dd0872ed81da7f004138e40b68a4b7e6b51 (patch) | |
tree | 6cfcd87ff4f19a1338134977859e3e2d80510084 /src/api | |
parent | chore: tag the 'recipes' submodule when tagging the main repo - to help ident... (diff) | |
download | ferdium-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.ts | 13 |
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 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import { session } from '@electron/remote'; | ||
3 | import du from 'du'; | 2 | import du from 'du'; |
4 | 3 | ||
5 | import { getServicePartitionsDirectory } from '../../helpers/service-helpers'; | 4 | import { 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 | } |