address @yann300 comments.

pull/3838/head
Joseph Izang 1 year ago
parent f4ec9c142d
commit 7ef56f0047
  1. 14
      apps/remix-ide/src/app/tabs/analysis-tab.js

@ -59,13 +59,15 @@ class AnalysisTab extends ViewPlugin {
this.event.register('staticAnaysisWarning', (count) => { this.event.register('staticAnaysisWarning', (count) => {
let payloadType = '' let payloadType = ''
this.hints && this.hints.length > 0 ? this.hints.forEach(hint => { let hasError = this.hints && this.hints.some(hint => hint.type === 'error')
if (hint.type === 'error') { if (hasError) {
payloadType = 'error' payloadType = 'error';
} else if (hint.type === 'warning' && payloadType !== 'error') { } else {
payloadType = 'warning' let hasWarning = this.hints.some(hint => hint.type === 'warning')
if (hasWarning) {
payloadType = 'warning';
} }
}) : payloadType = 'warning' }
if (count > 0) { if (count > 0) {
this.emit('statusChanged', { key: count, title: `${count} warning${count === 1 ? '' : 's'}`, type: payloadType }) this.emit('statusChanged', { key: count, title: `${count} warning${count === 1 ? '' : 's'}`, type: payloadType })

Loading…
Cancel
Save