best way to save what you love
Svelte collaborationdownloaderinstagramjavascriptmusicredditsocial-mediasoundcloudsveltetiktoktwittertypescriptvideovimeovkwebappyoutubeyoutube-downloader
web/storage: make opfs check more robust
jj1058014c968e
diff --git a/web/src/lib/storage.ts b/web/src/lib/storage.tsindex 767dc425..c7566bc8 100644--- a/web/src/lib/storage.ts+++ b/web/src/lib/storage.ts@@ -44,7 +44,10 @@ export class OPFSStorage {}static isAvailable() {- return !!navigator.storage?.getDirectory;+ if (typeof navigator === 'undefined')+ return false;++ return 'storage' in navigator && 'getDirectory' in navigator.storage;}}@@ -55,7 +58,7 @@ export const removeFromFileStorage = async (filename: string) => {}export const clearFileStorage = async () => {- if (navigator.storage.getDirectory) {+ if (OPFSStorage.isAvailable()) {const root = await navigator.storage.getDirectory();try {await root.removeEntry(COBALT_PROCESSING_DIR, { recursive: true });