web/storage: add clearCacheStorage function

This commit is contained in:
wukko 2025-02-06 23:45:03 +06:00
parent 1f79bf6e52
commit dc33c07b39
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -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 () => {
let estimate;
if (navigator.storage.estimate) {