fix migrating files

pull/933/head
yann300 4 years ago
parent 5e9df881ff
commit aaeea9d1b3
  1. 3
      apps/remix-ide/src/migrateFileSystem.js

@ -32,7 +32,7 @@ export async function migrateToWorkspace (fileManager, filePanel) {
if (Object.keys(files).length > 0) {
const workspaceName = 'default_workspace'
const workspacePath = joinPath('browser', workspaceProvider.workspacesPath, workspaceName)
await filePanel.createWorkspace(workspaceName)
await filePanel.processCreateWorkspace(workspaceName)
filePanel.getWorkspaces() // refresh list
await populateWorkspace(workspacePath, files, browserProvider)
}
@ -42,6 +42,7 @@ export async function migrateToWorkspace (fileManager, filePanel) {
const populateWorkspace = async (workspace, json, browserProvider) => {
for (const item in json) {
const isFolder = json[item].content === undefined
if (isFolder && item === '/.workspaces') continue // we don't want to replicate this one.
if (isFolder) {
browserProvider.createDir(joinPath(workspace, item))
await populateWorkspace(workspace, json[item].children, browserProvider)

Loading…
Cancel
Save