Commit 567ba0d0 authored by yann300's avatar yann300

make sure hardhat can be activated when using remixd

parent 43d5937f
...@@ -108,13 +108,21 @@ class CompileTab extends ViewPlugin { ...@@ -108,13 +108,21 @@ class CompileTab extends ViewPlugin {
this.call('editor', 'clearAnnotations') this.call('editor', 'clearAnnotations')
} }
this.on('filePanel', 'setWorkspace', (workspace) => { const resetView = (isLocalhost) => {
this.compileTabLogic.isHardhatProject().then((result) => { this.compileTabLogic.isHardhatProject().then((result) => {
if (result && workspace.isLocalhost) this.isHardHatProject = true if (result && isLocalhost) this.isHardHatProject = true
else this.isHardHatProject = false else this.isHardHatProject = false
this.renderComponent() this.renderComponent()
}) })
this.resetResults() 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) this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment