From 14790b009ab55d379e72e37c3bff7e5134a397cc Mon Sep 17 00:00:00 2001 From: a-crowell Date: Wed, 21 Aug 2024 14:56:40 -0700 Subject: [PATCH] canOPFS check --- fission/src/mirabuf/MirabufLoader.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fission/src/mirabuf/MirabufLoader.ts b/fission/src/mirabuf/MirabufLoader.ts index 3de634e5d..9d0d582fe 100644 --- a/fission/src/mirabuf/MirabufLoader.ts +++ b/fission/src/mirabuf/MirabufLoader.ts @@ -322,11 +322,13 @@ class MirabufCachingService { * Removes all Mirabuf files from the caching services. Mostly for debugging purposes. */ public static async RemoveAll() { - for await (const key of robotFolderHandle.keys()) { - robotFolderHandle.removeEntry(key) - } - for await (const key of fieldFolderHandle.keys()) { - fieldFolderHandle.removeEntry(key) + if (canOPFS) { + for await (const key of robotFolderHandle.keys()) { + robotFolderHandle.removeEntry(key) + } + for await (const key of fieldFolderHandle.keys()) { + fieldFolderHandle.removeEntry(key) + } } window.localStorage.setItem(robotsDirName, "{}")