catch an error of no current

pull/5370/head
lianahus 3 years ago
parent 15219e5014
commit 125c9558b7
  1. 6
      apps/remix-ide/src/app/tabs/compile-tab.js
  2. 10
      apps/remix-ide/src/app/tabs/test-tab.js

@ -124,7 +124,11 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA
path: [], path: [],
pattern: [] pattern: []
}) })
this.currentFile = await this.call('fileManager', 'file') try {
this.currentFile = await this.call('fileManager', 'file')
} catch (e) {
throw new Error(e)
}
} }
getCompilerParameters () { getCompilerParameters () {

@ -74,10 +74,10 @@ module.exports = class TestTab extends ViewPlugin {
} }
} }
onActivation () { async onActivation () {
const isSolidityActive = this.call('manager', 'isActive', 'solidity') const isSolidityActive = await this.call('manager', 'isActive', 'solidity')
if (!isSolidityActive) { if (!isSolidityActive) {
this.call('manager', 'activatePlugin', 'solidity') await this.call('manager', 'activatePlugin', 'solidity')
} }
} }
@ -625,7 +625,7 @@ module.exports = class TestTab extends ViewPlugin {
return this.generateFileActionElement return this.generateFileActionElement
} }
updateRunAction (currentFile) { async updateRunAction (currentFile) {
const el = yo` const el = yo`
<button id="runTestsTabRunAction" title="Run tests" data-id="testTabRunTestsTabRunAction" class="w-50 btn btn-primary" onclick="${() => this.runTests()}"> <button id="runTestsTabRunAction" title="Run tests" data-id="testTabRunTestsTabRunAction" class="w-50 btn btn-primary" onclick="${() => this.runTests()}">
<span class="fas fa-play ml-2"></span> <span class="fas fa-play ml-2"></span>
@ -639,7 +639,7 @@ module.exports = class TestTab extends ViewPlugin {
el.setAttribute('title', 'No solidity file selected') el.setAttribute('title', 'No solidity file selected')
} else { } else {
el.setAttribute('title', 'The "Solidity Plugin" should be activated') el.setAttribute('title', 'The "Solidity Plugin" should be activated')
this.call('manager', 'activatePlugin', 'solidity') await this.call('manager', 'activatePlugin', 'solidity')
} }
} }
if (!this.runActionElement) { if (!this.runActionElement) {

Loading…
Cancel
Save