diff --git a/apps/remix-ide/src/app/files/git-handle.js b/apps/remix-ide/src/app/files/git-handle.js index a935068679..596bf77015 100644 --- a/apps/remix-ide/src/app/files/git-handle.js +++ b/apps/remix-ide/src/app/files/git-handle.js @@ -15,4 +15,12 @@ export class GitHandle 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) + } } diff --git a/apps/remix-ide/src/app/files/slither-handle.js b/apps/remix-ide/src/app/files/slither-handle.js index 9604202d7e..27c7b3cbd8 100644 --- a/apps/remix-ide/src/app/files/slither-handle.js +++ b/apps/remix-ide/src/app/files/slither-handle.js @@ -16,4 +16,12 @@ export class SlitherHandle 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) + } } diff --git a/apps/remix-ide/src/app/plugins/remixd-handle.tsx b/apps/remix-ide/src/app/plugins/remixd-handle.tsx index 56855d4caf..35353d774d 100644 --- a/apps/remix-ide/src/app/plugins/remixd-handle.tsx +++ b/apps/remix-ide/src/app/plugins/remixd-handle.tsx @@ -71,6 +71,14 @@ export class RemixdHandle extends WebsocketPlugin { } + async callPluginMethod(key: string, payload?: any[]) { + if (this.socket.readyState !== this.socket.OPEN) { + console.log(`${this.profile.name} connection is not opened.`) + return false + } + return super.callPluginMethod(key, payload) + } + /** * connect to localhost if no connection and render the explorer * disconnect from localhost if connected and remove the explorer