Update file-panel.js

Bug fix: closing files when creating workspaces with the API
bunsenstraat-patch-4
bunsenstraat 3 years ago committed by GitHub
parent 13f961dada
commit 32d9ea5d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/remix-ide/src/app/panels/file-panel.js

@ -251,6 +251,7 @@ module.exports = class Filepanel extends ViewPlugin {
if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed') if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed')
if (await this.workspaceExists(workspaceName)) throw new Error('workspace already exists') if (await this.workspaceExists(workspaceName)) throw new Error('workspace already exists')
else { else {
await this.call('fileManager', 'closeAllFiles')
const workspaceProvider = this._deps.fileProviders.workspace const workspaceProvider = this._deps.fileProviders.workspace
await this.processCreateWorkspace(workspaceName) await this.processCreateWorkspace(workspaceName)
workspaceProvider.setWorkspace(workspaceName) workspaceProvider.setWorkspace(workspaceName)

Loading…
Cancel
Save