Commit f9fc875a authored by ioedeveloper's avatar ioedeveloper

Set default workspace

parent ba2ad421
...@@ -171,8 +171,20 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -171,8 +171,20 @@ module.exports = class Filepanel extends ViewPlugin {
if (error) console.error(error) if (error) console.error(error)
if (Object.keys(filesList).length === 0) { if (Object.keys(filesList).length === 0) {
await this.createWorkspace('default_workspace') await this.createWorkspace('default_workspace')
resolve('default_workspace')
} else {
this._deps.fileProviders.browser.resolveDirectory('.workspaces', async (error, filesList) => {
if (error) console.error(error)
if (Object.keys(filesList).length > 0) {
const workspacePath = Object.keys(filesList)[0].split('/').filter(val => val)
const workspaceName = workspacePath[workspacePath.length - 1]
this._deps.fileProviders.workspace.setWorkspace(workspaceName)
resolve(workspaceName)
}
reject(new Error('Can\'t find available workspace.'))
})
} }
resolve(true)
}) })
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment