the file removed event is blocked (#753)

The file removed event will not be emitted if the file is deleted when it is not opened. This happens for example when you right click on the file without first openening it.
pull/5370/head
bunsenstraat 4 years ago committed by GitHub
parent 04b0a6745e
commit 3ec0d938cd
  1. 6
      apps/remix-ide/src/app/files/fileManager.js

@ -424,15 +424,15 @@ class FileManager extends Plugin {
}
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')) {
this._deps.config.set('currentFile', '')
}
this.editor.discard(path)
delete this.openedFiles[path]
// TODO: Only keep `this.emit` (issue#2210)
this.emit('fileRemoved', path)
this.events.emit('fileRemoved', path)
this.openFile()
}

Loading…
Cancel
Save