Merge pull request #763 from ethereum/bunsenstraat-patch-1

Update fileManager.js
pull/767/head
bunsenstraat 4 years ago committed by GitHub
commit 9c72cea3a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      apps/remix-ide/src/app/files/fileManager.js

@ -424,15 +424,14 @@ class FileManager extends Plugin {
} }
fileRemovedEvent (path) { fileRemovedEvent (path) {
// TODO: Only keep `this.emit` (issue#2210)
this.emit('fileRemoved', path)
this.events.emit('fileRemoved', path)
if (!this.openedFiles[path]) return
if (path === this._deps.config.get('currentFile')) { if (path === this._deps.config.get('currentFile')) {
this._deps.config.set('currentFile', '') this._deps.config.set('currentFile', '')
} }
this.editor.discard(path) this.editor.discard(path)
delete this.openedFiles[path] delete this.openedFiles[path]
// TODO: Only keep `this.emit` (issue#2210)
this.emit('fileRemoved', path)
this.events.emit('fileRemoved', path)
this.openFile() this.openFile()
} }

Loading…
Cancel
Save