pull/5370/head
filip mertens 3 years ago
parent 20b2a111ba
commit b6b3200ba9
  1. 30
      apps/remix-ide/src/assets/js/init.js

@ -96,11 +96,35 @@ window.onload = () => {
}
}
}
window.remixFileSystemCallback = new RemixFileSystem()
window.remixFileSystemCallback.init('RemixFileSystem').then(() => {
window.remixFileSystem = window.remixFileSystemCallback.promises
function loadApp(){
const app = document.createElement('script')
app.setAttribute('src', versions[versionToLoad])
document.body.appendChild(app)
}
function migrateFiles(){
BrowserFS.install(window)
BrowserFS.configure({
fs: "LocalStorage"
}, function(e) {
if (e) console.log(e)
let browserFS = require('fs')
console.log(browserFS)
})
}
window.remixFileSystemCallback = new RemixFileSystem()
window.remixFileSystemCallback.init('RemixFileSystem').then(() => {
window.remixFileSystem = window.remixFileSystemCallback.promises
// check if .workspaces is present in indexeddb
window.remixFileSystem.stat('.workspaces2').then((dir) => {
if(dir.isDirectory()) loadApp()
}).catch(()=>{
// no indexeddb workspaces
console.log("loading localstorage FS")
migrateFiles();
});
})
}

Loading…
Cancel
Save