handle connections in plugins

pull/5370/head
filip mertens 2 years ago
parent cc5bca1bab
commit 7d314b4bda
  1. 8
      apps/remix-ide/src/app/files/foundry-handle.js
  2. 8
      apps/remix-ide/src/app/files/hardhat-handle.js
  3. 11
      apps/remix-ide/src/app/files/truffle-handle.js

@ -15,4 +15,12 @@ export class FoundryHandle extends WebsocketPlugin {
constructor () {
super(profile)
}
callPluginMethod(key, payload = []) {
if (this.socket.readyState !== this.socket.OPEN) {
console.log(`${this.profile.name} connection is not opened.`)
return false
}
return super.callPluginMethod(key, payload)
}
}

@ -15,4 +15,12 @@ export class HardhatHandle extends WebsocketPlugin {
constructor () {
super(profile)
}
callPluginMethod(key, payload = []) {
if (this.socket.readyState !== this.socket.OPEN) {
console.log(`${this.profile.name} connection is not opened.`)
return false
}
return super.callPluginMethod(key, payload)
}
}

@ -12,7 +12,16 @@ const profile = {
}
export class TruffleHandle extends WebsocketPlugin {
constructor () {
constructor() {
super(profile)
}
callPluginMethod(key, payload = []) {
if (this.socket.readyState !== this.socket.OPEN) {
console.log(`${this.profile.name} connection is not opened.`)
return false
}
return super.callPluginMethod(key, payload)
}
}

Loading…
Cancel
Save