mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-11 03:04:26 +02:00
web/opfs: make removeFromFileStorage() more robust
This commit is contained in:
parent
b6a207a9b0
commit
d83d448190
@ -47,9 +47,14 @@ export class OPFSStorage extends AbstractStorage {
|
||||
}
|
||||
|
||||
export const removeFromFileStorage = async (filename: string) => {
|
||||
const root = await navigator.storage.getDirectory();
|
||||
const cobaltDir = await root.getDirectoryHandle(COBALT_PROCESSING_DIR);
|
||||
return await cobaltDir.removeEntry(filename);
|
||||
if (OPFSStorage.isAvailable()) {
|
||||
const root = await navigator.storage.getDirectory();
|
||||
const cobaltDir = await root.getDirectoryHandle(COBALT_PROCESSING_DIR);
|
||||
|
||||
try {
|
||||
await cobaltDir.removeEntry(filename);
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
export const clearFileStorage = async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user