Fixed deactivate bug

pull/262/head
ioedeveloper 4 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, localhostExplorer: this._components.registry.get('fileproviders/localhost').api,
filesProviders: this._components.registry.get('fileproviders').api filesProviders: this._components.registry.get('fileproviders').api
} }
// this._deps.browserExplorer.event.register('fileChanged', (path) => { this.fileChangedEvent(path) }) 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.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.localhostExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) })
// this._deps.browserExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) 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('fileRemoved', (path) => { this.fileRemovedEvent(path) })
// this._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) 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.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(this._deps.localhostExplorer) })
this.getCurrentFile = this.file this.getCurrentFile = this.file
this.getFile = this.readFile this.getFile = this.readFile
this.getFolder = this.readdir this.getFolder = this.readdir

@ -111,10 +111,11 @@ module.exports = class RemixDProvider {
} }
set (path, content, cb) { set (path, content, cb) {
var unprefixedpath = this.removePrefix(path) const unprefixedpath = this.removePrefix(path)
this._appManager.call('remixd', 'set', {path: unprefixedpath, content: content}, (error, result) => { this._appManager.call('remixd', 'set', {path: unprefixedpath, content: content}).then((result) => {
if (cb) return cb(error, result) if (cb) return cb(null, result)
var path = this.type + '/' + unprefixedpath
const path = this.type + '/' + unprefixedpath
this.event.trigger('fileChanged', [path]) this.event.trigger('fileChanged', [path])
}) })
return true return true

@ -37,7 +37,7 @@ export class RemixdHandle extends WebsocketPlugin {
} }
deactivate () { deactivate () {
super.deactivate() if (super.socket) super.deactivate()
this.locahostProvider.close((error) => { this.locahostProvider.close((error) => {
if (error) console.log(error) if (error) console.log(error)
}) })
@ -47,7 +47,7 @@ export class RemixdHandle extends WebsocketPlugin {
this.connectToLocalhost() this.connectToLocalhost()
} }
canceled () { async canceled () {
this.appManager.ensureDeactivated('remixd') this.appManager.ensureDeactivated('remixd')
} }
@ -57,7 +57,7 @@ export class RemixdHandle extends WebsocketPlugin {
* *
* @param {String} txHash - hash of the transaction * @param {String} txHash - hash of the transaction
*/ */
async connectToLocalhost () { connectToLocalhost () {
let connection = (error) => { let connection = (error) => {
if (error) { if (error) {
console.log(error) console.log(error)

Loading…
Cancel
Save