web/storage: add clearCacheStorage function
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user