fine tuning

pull/2113/head
bunsenstraat 3 years ago
parent daf5508e2c
commit c64735ad2f
  1. 8
      apps/remix-ide/src/app/components/preload.tsx
  2. 2
      apps/remix-ide/src/app/files/filesystems/indexedDB.ts

@ -50,7 +50,7 @@ export const Preload = () => {
await setFileSystems() await setFileSystems()
} }
const setFileSystems = async () => { const setFileSystems = async() => {
const fsLoaded = await remixFileSystems.current.setFileSystem([remixIndexedDB.current, localStorageFileSystem.current]) const fsLoaded = await remixFileSystems.current.setFileSystem([remixIndexedDB.current, localStorageFileSystem.current])
if (fsLoaded) { if (fsLoaded) {
console.log(fsLoaded.name + ' activated') console.log(fsLoaded.name + ' activated')
@ -64,8 +64,10 @@ export const Preload = () => {
async function loadStorage() { async function loadStorage() {
await remixFileSystems.current.addFileSystem(remixIndexedDB.current) await remixFileSystems.current.addFileSystem(remixIndexedDB.current)
await remixFileSystems.current.addFileSystem(localStorageFileSystem.current) await remixFileSystems.current.addFileSystem(localStorageFileSystem.current)
await remixIndexedDB.current.checkWorkspaces() remixIndexedDB.current.loaded && await remixIndexedDB.current.checkWorkspaces()
remixIndexedDB.current.hasWorkSpaces ? await setFileSystems() : setShowDownloader(true) 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() loadStorage()
}, []) }, [])

@ -75,7 +75,7 @@ export class indexedDBFileSystem extends fileSystem {
this.available = false this.available = false
reject('No indexedDB on window') reject('No indexedDB on window')
} }
const request = window.indexedDB.open("RemixTestDataBase", 3); const request = window.indexedDB.open("RemixTestDataBase");
request.onerror = () => { request.onerror = () => {
this.available = false this.available = false
reject('Error creating test database') reject('Error creating test database')

Loading…
Cancel
Save