mirror of
https://github.com/wukko/cobalt.git
synced 2025-02-15 15:26:34 +01:00
web/storage: add clearCacheStorage function
This commit is contained in:
parent
1f79bf6e52
commit
dc33c07b39
1 changed files with 8 additions and 0 deletions
|
@ -64,6 +64,14 @@ export const clearFileStorage = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const clearCacheStorage = async () => {
|
||||||
|
const keys = await caches.keys();
|
||||||
|
|
||||||
|
for (const key of keys) {
|
||||||
|
caches.delete(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const getStorageQuota = async () => {
|
export const getStorageQuota = async () => {
|
||||||
let estimate;
|
let estimate;
|
||||||
if (navigator.storage.estimate) {
|
if (navigator.storage.estimate) {
|
||||||
|
|
Loading…
Reference in a new issue