aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/server/LocalApi.js
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-07-30 10:54:54 +0200
committerLibravatar GitHub <noreply@github.com>2021-07-30 14:24:54 +0530
commitf4b4416ea52d564bc2dbe543a82084ed98843ccc (patch)
tree7ca6b23571c86458a6b799746c91a7191de02715 /src/api/server/LocalApi.js
parent5.6.1-nightly.8 [skip ci] (diff)
downloadferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.gz
ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.zst
ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.zip
chore: migrate from tslint to @typescript-eslint (#1706)
- update .eslintrc to work for .js and .ts - update devDependencies - lint properly both root /src and nested /packages - update webhint recommended setting for tsconfig.json to shrink output - Manage all eslint rules from the repo root - escape single quotes in scripts to please windows build Co-authored-by: Vijay A <avijayr@protonmail.com>
Diffstat (limited to 'src/api/server/LocalApi.js')
-rw-r--r--src/api/server/LocalApi.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/api/server/LocalApi.js b/src/api/server/LocalApi.js
index 4b1f03f22..2d5bd8b80 100644
--- a/src/api/server/LocalApi.js
+++ b/src/api/server/LocalApi.js
@@ -2,7 +2,7 @@ import { ipcRenderer } from 'electron';
2import { session } from '@electron/remote'; 2import { session } from '@electron/remote';
3import du from 'du'; 3import du from 'du';
4 4
5import { getServicePartitionsDirectory } from '../../helpers/service-helpers.js'; 5import { getServicePartitionsDirectory } from '../../helpers/service-helpers';
6 6
7const debug = require('debug')('Ferdi:LocalApi'); 7const debug = require('debug')('Ferdi:LocalApi');
8 8
@@ -41,11 +41,23 @@ export default class LocalApi {
41 } 41 }
42 42
43 async clearCache(serviceId = null) { 43 async clearCache(serviceId = null) {
44 const s = serviceId ? session.fromPartition(`persist:service-${serviceId}`) : session.defaultSession; 44 const s = serviceId
45 ? session.fromPartition(`persist:service-${serviceId}`)
46 : session.defaultSession;
45 47
46 debug('LocalApi::clearCache resolves', (serviceId || 'clearAppCache')); 48 debug('LocalApi::clearCache resolves', serviceId || 'clearAppCache');
47 await s.clearStorageData({ 49 await s.clearStorageData({
48 storages: ['appcache', 'cookies', 'filesystem', 'indexdb', 'localstorage', 'shadercache', 'websql', 'serviceworkers', 'cachestorage'], 50 storages: [
51 'appcache',
52 'cookies',
53 'filesystem',
54 'indexdb',
55 'localstorage',
56 'shadercache',
57 'websql',
58 'serviceworkers',
59 'cachestorage',
60 ],
49 quotas: ['temporary', 'persistent', 'syncable'], 61 quotas: ['temporary', 'persistent', 'syncable'],
50 }); 62 });
51 return s.clearCache(); 63 return s.clearCache();