lib/opfs: move getting dir into remove() try catch
This commit is contained in:
@@ -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 {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user