Fixed deactivate bug

uiCheck
ioedeveloper 5 years ago committed by yann300
parent 12c4ef65d3
commit b437dd18ac
  1. 14
      src/app/files/fileManager.js
  2. 9
      src/app/files/remixDProvider.js
  3. 6
      src/app/files/remixd-handle.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

@ -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

@ -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)

Loading…
Cancel
Save