mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-16 21:37:06 +02:00
lib/opfs: move getting dir into remove() try catch
This commit is contained in:
parent
d83d448190
commit
42b7a6ae60
@ -49,9 +49,9 @@ export class OPFSStorage extends AbstractStorage {
|
|||||||
export const removeFromFileStorage = async (filename: string) => {
|
export const removeFromFileStorage = async (filename: string) => {
|
||||||
if (OPFSStorage.isAvailable()) {
|
if (OPFSStorage.isAvailable()) {
|
||||||
const root = await navigator.storage.getDirectory();
|
const root = await navigator.storage.getDirectory();
|
||||||
const cobaltDir = await root.getDirectoryHandle(COBALT_PROCESSING_DIR);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const cobaltDir = await root.getDirectoryHandle(COBALT_PROCESSING_DIR);
|
||||||
await cobaltDir.removeEntry(filename);
|
await cobaltDir.removeEntry(filename);
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user