pull/2113/head
bunsenstraat 3 years ago
parent c64735ad2f
commit 3024c96c94
  1. 8
      apps/remix-ide/src/app/components/preload.tsx
  2. 4
      apps/remix-ide/src/app/files/fileSystem.ts
  3. 0
      apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts

@ -5,7 +5,7 @@ import * as packageJson from '../../../../../package.json'
import { fileSystem, fileSystems } from '../files/fileSystem'
import { indexedDBFileSystem } from '../files/filesystems/indexedDB'
import { localStorageFS } from '../files/filesystems/localStorage'
import { fileSystemUtility } from '../files/filesystems/migrateFileSystem'
import { fileSystemUtility } from '../files/filesystems/fileSystemUtility'
import './preload.css'
export const Preload = () => {
@ -40,10 +40,6 @@ export const Preload = () => {
await migrateAndLoad()
}
const skipBackup = async () => {
await migrateAndLoad()
}
const migrateAndLoad = async () => {
const fsUtility = new fileSystemUtility()
await fsUtility.migrate(localStorageFileSystem.current, remixIndexedDB.current)
@ -97,7 +93,7 @@ export const Preload = () => {
<br></br>
You don't need to do anything else, your files will be available when the app loads.
<div onClick={async () => { await downloadBackup() }} className='btn btn-primary mt-1'>download backup</div>
<div onClick={async () => { await skipBackup() }} className='btn btn-primary mt-1'>skip backup</div>
<div onClick={async () => { await migrateAndLoad() }} className='btn btn-primary mt-1'>skip backup</div>
</div> : null}
{(supported && !error && !showDownloader) ?
<div>

@ -54,10 +54,10 @@ export class fileSystems {
this.fileSystems = {}
}
addFileSystem = async (fs: fileSystem) => {
addFileSystem = async (fs: fileSystem): Promise<boolean> => {
try {
this.fileSystems[fs.name] = fs
if (await fs.test()) await fs.load()
await fs.test() && await fs.load()
console.log(fs.name + ' is loaded...')
return true
} catch (e) {

Loading…
Cancel
Save