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 { fileSystem, fileSystems } from '../files/fileSystem'
import { indexedDBFileSystem } from '../files/filesystems/indexedDB' import { indexedDBFileSystem } from '../files/filesystems/indexedDB'
import { localStorageFS } from '../files/filesystems/localStorage' import { localStorageFS } from '../files/filesystems/localStorage'
import { fileSystemUtility } from '../files/filesystems/migrateFileSystem' import { fileSystemUtility } from '../files/filesystems/fileSystemUtility'
import './preload.css' import './preload.css'
export const Preload = () => { export const Preload = () => {
@ -40,10 +40,6 @@ export const Preload = () => {
await migrateAndLoad() await migrateAndLoad()
} }
const skipBackup = async () => {
await migrateAndLoad()
}
const migrateAndLoad = async () => { const migrateAndLoad = async () => {
const fsUtility = new fileSystemUtility() const fsUtility = new fileSystemUtility()
await fsUtility.migrate(localStorageFileSystem.current, remixIndexedDB.current) await fsUtility.migrate(localStorageFileSystem.current, remixIndexedDB.current)
@ -97,7 +93,7 @@ export const Preload = () => {
<br></br> <br></br>
You don't need to do anything else, your files will be available when the app loads. 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 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} </div> : null}
{(supported && !error && !showDownloader) ? {(supported && !error && !showDownloader) ?
<div> <div>

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

Loading…
Cancel
Save