add properties to aid badge color change

pull/3892/head
Joseph Izang 1 year ago
parent 72f17bf2ab
commit d82c33260b
  1. 7
      apps/remix-ide/src/app/tabs/analysis-tab.js

@ -38,6 +38,9 @@ class AnalysisTab extends ViewPlugin {
} }
this.dispatch = null this.dispatch = null
this.hints = [] this.hints = []
this.basicEnabled = false
this.solhintEnabled = false
this.slitherEnabled = false
} }
async onActivation () { async onActivation () {
@ -50,14 +53,14 @@ class AnalysisTab extends ViewPlugin {
this.event.register('staticAnaysisWarning', (count) => { this.event.register('staticAnaysisWarning', (count) => {
let payloadType = '' let payloadType = ''
const error = this.hints?.find(hint => hint.type === 'error') const error = this.hints?.find(hint => hint.type === 'error')
if (error) { if (error && this.solhintEnabled) {
payloadType = 'error' payloadType = 'error'
} else { } else {
payloadType = 'warning' payloadType = 'warning'
} }
if (count > 0) { if (count > 0) {
this.emit('statusChanged', { key: count, title: payloadType === 'error' ? `You have ${count} problem${count === 1 ? '' : 's'}` : 'You have some warnings', type: payloadType }) this.emit('statusChanged', { key: count, title: payloadType === 'error' ? `You have ${count} problem${count === 1 ? '' : 's'}` : `You have ${count} warnings`, type: payloadType })
} else if (count === 0) { } else if (count === 0) {
this.emit('statusChanged', { key: 'succeed', title: 'no warnings or errors', type: 'success' }) this.emit('statusChanged', { key: 'succeed', title: 'no warnings or errors', type: 'success' })
} else { } else {

Loading…
Cancel
Save