improve file migration

pull/5370/head
yann300 4 years ago
parent 09040b5da5
commit 4fa2ef0a2f
  1. 12
      apps/remix-ide/src/migrateFileSystem.js

@ -29,11 +29,13 @@ export async function migrateToWorkspace (fileManager, filePanel) {
if (fileStorageBrowserWorkspace.get(flag) === 'done') return if (fileStorageBrowserWorkspace.get(flag) === 'done') return
const files = await browserProvider.copyFolderToJson('/') const files = await browserProvider.copyFolderToJson('/')
console.log(files) console.log(files)
const workspaceName = 'default_workspace' if (Object.keys(files).length > 0) {
const workspacePath = joinPath('browser', workspaceProvider.workspacesPath, workspaceName) const workspaceName = 'default_workspace'
await filePanel.createWorkspace(workspaceName) const workspacePath = joinPath('browser', workspaceProvider.workspacesPath, workspaceName)
filePanel.getWorkspaces() // refresh list await filePanel.createWorkspace(workspaceName)
await populateWorkspace(workspacePath, files, browserProvider) filePanel.getWorkspaces() // refresh list
await populateWorkspace(workspacePath, files, browserProvider)
}
fileStorageBrowserWorkspace.set(flag, 'done') fileStorageBrowserWorkspace.set(flag, 'done')
} }

Loading…
Cancel
Save