Commit 62424e83 authored by LianaHus's avatar LianaHus Committed by Liana Husikyan

do not update results when autorun is off

parent 77cfd4a2
...@@ -17,6 +17,7 @@ function staticAnalysisView (localRegistry, analysisModule) { ...@@ -17,6 +17,7 @@ function staticAnalysisView (localRegistry, analysisModule) {
this.modulesView = this.renderModules() this.modulesView = this.renderModules()
this.lastCompilationResult = null this.lastCompilationResult = null
this.lastCompilationSource = null this.lastCompilationSource = null
this.currentFile = 'No file compiled'
self._components = { self._components = {
renderer: new Renderer() renderer: new Renderer()
} }
...@@ -29,13 +30,12 @@ function staticAnalysisView (localRegistry, analysisModule) { ...@@ -29,13 +30,12 @@ function staticAnalysisView (localRegistry, analysisModule) {
analysisModule.on('solidity', 'compilationFinished', (file, source, languageVersion, data) => { analysisModule.on('solidity', 'compilationFinished', (file, source, languageVersion, data) => {
self.lastCompilationResult = null self.lastCompilationResult = null
self.lastCompilationSource = null self.lastCompilationSource = null
$('#staticanalysisresult').empty()
if (languageVersion.indexOf('soljson') !== 0) return if (languageVersion.indexOf('soljson') !== 0) return
self.lastCompilationResult = data self.lastCompilationResult = data
if (self.view) self.view.querySelector('#staticAnalysisCurrentFile').innerText = file
self.lastCompilationSource = source self.lastCompilationSource = source
this.correctRunBtnDisabled() self.currentFile = file
if (self.view.querySelector('#autorunstaticanalysis').checked) { self.correctRunBtnDisabled()
if (self.view && self.view.querySelector('#autorunstaticanalysis').checked) {
self.run() self.run()
} }
}) })
...@@ -75,8 +75,8 @@ staticAnalysisView.prototype.render = function () { ...@@ -75,8 +75,8 @@ staticAnalysisView.prototype.render = function () {
${this.modulesView} ${this.modulesView}
</div> </div>
<div class="mt-2 p-2 d-flex border-top flex-column"> <div class="mt-2 p-2 d-flex border-top flex-column">
<span>Result for:</span> <span>The last results for:</span>
<span class="text-break break-word word-break font-weight-bold" id="staticAnalysisCurrentFile">No file compiled</span> <span class="text-break break-word word-break font-weight-bold" id="staticAnalysisCurrentFile">${this.currentFile}</span>
</div> </div>
<div class="${css.result} my-1" id='staticanalysisresult'></div> <div class="${css.result} my-1" id='staticanalysisresult'></div>
</div> </div>
...@@ -108,6 +108,7 @@ staticAnalysisView.prototype.run = function () { ...@@ -108,6 +108,7 @@ staticAnalysisView.prototype.run = function () {
const selected = this.selectedModules() const selected = this.selectedModules()
const warningContainer = $('#staticanalysisresult') const warningContainer = $('#staticanalysisresult')
warningContainer.empty() warningContainer.empty()
this.view.querySelector('#staticAnalysisCurrentFile').innerText = this.currentFile
var self = this var self = this
if (this.lastCompilationResult && selected.length) { if (this.lastCompilationResult && selected.length) {
this.runBtn.removeAttribute('disabled') this.runBtn.removeAttribute('disabled')
......
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