From a5a8888a9e544b869b52bb36436f295cf4acaa32 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 12 Aug 2021 10:49:39 +0200 Subject: [PATCH] make sure hardhat can be activated when using remixd --- apps/remix-ide/src/app/tabs/compile-tab.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 14ca4ae30e..2352e5db9a 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -108,13 +108,21 @@ class CompileTab extends ViewPlugin { this.call('editor', 'clearAnnotations') } - this.on('filePanel', 'setWorkspace', (workspace) => { + const resetView = (isLocalhost) => { this.compileTabLogic.isHardhatProject().then((result) => { - if (result && workspace.isLocalhost) this.isHardHatProject = true + if (result && isLocalhost) this.isHardHatProject = true else this.isHardHatProject = false this.renderComponent() }) this.resetResults() + } + + this.on('filePanel', 'setWorkspace', (workspace) => { + resetView(workspace.isLocalhost) + }) + + this.on('remixd', 'rootFolderChanged', () => { + resetView(true) }) this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation)