diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 3d17d7c12c..6699179c06 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -266,13 +266,13 @@ class FileManager extends Plugin { localhostExplorer: this._components.registry.get('fileproviders/localhost').api, filesProviders: this._components.registry.get('fileproviders').api } - // this._deps.browserExplorer.event.register('fileChanged', (path) => { this.fileChangedEvent(path) }) - // this._deps.browserExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) - // this._deps.localhostExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) - // this._deps.browserExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) - // this._deps.localhostExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) - // this._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) - // this._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) + this._deps.browserExplorer.event.register('fileChanged', (path) => { this.fileChangedEvent(path) }) + this._deps.browserExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) + this._deps.localhostExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) + this._deps.browserExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) + this._deps.localhostExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) + this._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) + this._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) this.getCurrentFile = this.file this.getFile = this.readFile this.getFolder = this.readdir diff --git a/src/app/files/remixDProvider.js b/src/app/files/remixDProvider.js index 979b67af98..95ebfe5d3a 100644 --- a/src/app/files/remixDProvider.js +++ b/src/app/files/remixDProvider.js @@ -111,10 +111,11 @@ module.exports = class RemixDProvider { } set (path, content, cb) { - var unprefixedpath = this.removePrefix(path) - this._appManager.call('remixd', 'set', {path: unprefixedpath, content: content}, (error, result) => { - if (cb) return cb(error, result) - var path = this.type + '/' + unprefixedpath + const unprefixedpath = this.removePrefix(path) + this._appManager.call('remixd', 'set', {path: unprefixedpath, content: content}).then((result) => { + if (cb) return cb(null, result) + + const path = this.type + '/' + unprefixedpath this.event.trigger('fileChanged', [path]) }) return true diff --git a/src/app/files/remixd-handle.js b/src/app/files/remixd-handle.js index b3a2fdd7de..bbd58d4f3c 100644 --- a/src/app/files/remixd-handle.js +++ b/src/app/files/remixd-handle.js @@ -37,7 +37,7 @@ export class RemixdHandle extends WebsocketPlugin { } deactivate () { - super.deactivate() + if (super.socket) super.deactivate() this.locahostProvider.close((error) => { if (error) console.log(error) }) @@ -47,7 +47,7 @@ export class RemixdHandle extends WebsocketPlugin { this.connectToLocalhost() } - canceled () { + async canceled () { this.appManager.ensureDeactivated('remixd') } @@ -57,7 +57,7 @@ export class RemixdHandle extends WebsocketPlugin { * * @param {String} txHash - hash of the transaction */ - async connectToLocalhost () { + connectToLocalhost () { let connection = (error) => { if (error) { console.log(error)