emit fileSaved and fileAdded

pull/601/head
yann300 4 years ago
parent 3bd52b9f19
commit 9bc06c2ab7
  1. 6
      apps/remix-ide/src/app/files/fileManager.js

@ -158,7 +158,9 @@ class FileManager extends Plugin {
await this._handleIsFile(path, `Cannot write file ${path}`)
return await this.setFileContent(path, data)
} else {
return await this.setFileContent(path, data)
const ret = this.setFileContent(path, data)
this.emit('fileAdded', path)
return ret
}
}
@ -396,6 +398,7 @@ class FileManager extends Plugin {
provider.set(path, content, (error) => {
if (error) reject(error)
this.syncEditor(path)
this.emit('fileSaved', path)
resolve(true)
})
})
@ -528,6 +531,7 @@ class FileManager extends Plugin {
var provider = this.fileProviderOf(currentFile)
if (provider) {
provider.set(currentFile, input)
this.emit('fileSaved', currentFile)
} else {
console.log('cannot save ' + currentFile + '. Does not belong to any explorer')
}

Loading…
Cancel
Save