Merge pull request #3281 from ethereum/hideWarnings

fix hide warnings
yul
David Disu 2 years ago committed by GitHub
commit b3fe717fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      apps/solidity-compiler/src/app/compiler-api.ts
  2. 2
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx

@ -283,10 +283,12 @@ export const CompilerApiMixin = (Base) => class extends Base {
if (success) { if (success) {
// forwarding the event to the appManager infra // forwarding the event to the appManager infra
this.emit('compilationFinished', source.target, source, 'soljson', data, input, version) this.emit('compilationFinished', source.target, source, 'soljson', data, input, version)
if (data.errors && data.errors.length > 0) { const hideWarnings = await this.getAppParameter('hideWarnings')
if (data.errors && data.errors.length > 0 && !hideWarnings) {
const warningsCount = data.errors.length
this.statusChanged({ this.statusChanged({
key: data.errors.length, key: warningsCount,
title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`, title: `compilation successful with ${warningsCount} warning${warningsCount > 1 ? 's' : ''}`,
type: 'warning' type: 'warning'
}) })
} else this.statusChanged({ key: 'succeed', title: 'compilation successful', type: 'success' }) } else this.statusChanged({ key: 'succeed', title: 'compilation successful', type: 'success' })

@ -43,7 +43,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
const hide = await api.getAppParameter('hideWarnings') as boolean || false const hide = await api.getAppParameter('hideWarnings') as boolean || false
setHideWarnings(hide) setHideWarnings(hide)
})() })()
}, []) }, [compileErrors])
useEffect(() => { useEffect(() => {
if (badgeStatus[currentFile]) { if (badgeStatus[currentFile]) {

Loading…
Cancel
Save