From c64735ad2f03b097df11a87329037a77b3598f1d Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sun, 27 Feb 2022 23:22:54 +0100 Subject: [PATCH] fine tuning --- apps/remix-ide/src/app/components/preload.tsx | 8 +++++--- apps/remix-ide/src/app/files/filesystems/indexedDB.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/components/preload.tsx b/apps/remix-ide/src/app/components/preload.tsx index f8011c06c8..e778d610de 100644 --- a/apps/remix-ide/src/app/components/preload.tsx +++ b/apps/remix-ide/src/app/components/preload.tsx @@ -50,7 +50,7 @@ export const Preload = () => { await setFileSystems() } - const setFileSystems = async () => { + const setFileSystems = async() => { const fsLoaded = await remixFileSystems.current.setFileSystem([remixIndexedDB.current, localStorageFileSystem.current]) if (fsLoaded) { console.log(fsLoaded.name + ' activated') @@ -64,8 +64,10 @@ export const Preload = () => { async function loadStorage() { await remixFileSystems.current.addFileSystem(remixIndexedDB.current) await remixFileSystems.current.addFileSystem(localStorageFileSystem.current) - await remixIndexedDB.current.checkWorkspaces() - remixIndexedDB.current.hasWorkSpaces ? await setFileSystems() : setShowDownloader(true) + remixIndexedDB.current.loaded && await remixIndexedDB.current.checkWorkspaces() + localStorageFileSystem.current.loaded && await localStorageFileSystem.current.checkWorkspaces() + remixIndexedDB.current.loaded && ( (remixIndexedDB.current.hasWorkSpaces || !localStorageFileSystem.current.hasWorkSpaces)? await setFileSystems():setShowDownloader(true)) + !remixIndexedDB.current.loaded && await setFileSystems() } loadStorage() }, []) diff --git a/apps/remix-ide/src/app/files/filesystems/indexedDB.ts b/apps/remix-ide/src/app/files/filesystems/indexedDB.ts index b62032cf25..5d20a52061 100644 --- a/apps/remix-ide/src/app/files/filesystems/indexedDB.ts +++ b/apps/remix-ide/src/app/files/filesystems/indexedDB.ts @@ -75,7 +75,7 @@ export class indexedDBFileSystem extends fileSystem { this.available = false reject('No indexedDB on window') } - const request = window.indexedDB.open("RemixTestDataBase", 3); + const request = window.indexedDB.open("RemixTestDataBase"); request.onerror = () => { this.available = false reject('Error creating test database')