Commit ade6fdf5 authored by yann300's avatar yann300 Committed by davidzagi93@gmail.com

Fix Error count in solidity compiler badge

parent 1e7adb43
...@@ -264,7 +264,7 @@ export const CompilerApiMixin = (Base) => class extends Base { ...@@ -264,7 +264,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
) )
}) })
} else { } else {
const count = (data.errors ? data.errors.filter(error => error.severity === 'error').length : 0) + data.error ? 1 : 0 const count = (data.errors ? data.errors.filter(error => error.severity === 'error').length : 0 + (data.error ? 1 : 0))
this.emit('statusChanged', { key: count, title: `compilation failed with ${count} error${count > 1 ? 's' : ''}`, type: 'error' }) this.emit('statusChanged', { key: count, title: `compilation failed with ${count} error${count > 1 ? 's' : ''}`, type: 'error' })
} }
// Update contract Selection // Update contract Selection
......
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