Trigger add folder event

pull/11/head
ioedeveloper 4 years ago
parent 3225df0713
commit 507ad94573
  1. 9
      apps/remix-ide/src/app/files/remixDProvider.js

@ -24,7 +24,7 @@ module.exports = class RemixDProvider {
this._appManager.on('remixd', 'folderAdded', (path) => {
console.log('event listener called')
this.event.trigger('folderAdded', [path])
this.event.trigger('folderAdded', [this.addPrefix(path)])
})
this._appManager.on('remixd', 'notified', (data) => {
@ -182,11 +182,18 @@ module.exports = class RemixDProvider {
return path
}
addPrefix (path) {
if (path.indexOf(this.type + '/') === 0) return path
if (path[0] === '/') return 'localhost' + path
return 'localhost/' + path
}
resolveDirectory (path, callback) {
var self = this
if (path[0] === '/') path = path.substring(1)
if (!path) return callback(null, { [self.type]: { } })
const unprefixedpath = this.removePrefix(path)
console.log('unprefixedpath: ', unprefixedpath)
this._appManager.call('remixd', 'resolveDirectory', { path: unprefixedpath }).then((result) => {
callback(null, result)
}).catch(callback)

Loading…
Cancel
Save