Merge pull request #2292 from ethereum/statusUpdate

check for key is defined
pull/3094/head
yann300 5 years ago committed by GitHub
commit c1e3d07e77
  1. 2
      src/app/components/vertical-icons.js
  2. 2
      src/app/tabs/compile-tab.js

@ -48,7 +48,7 @@ export class VerticalIcons extends Plugin {
const types = ['error', 'warning', 'success', 'info', '']
const fn = (status) => {
if (!types.includes(status.type) && status.type) throw new Error(`type should be ${keys.join()}`)
if (!status.key) throw new Error(`status key should be defined`)
if (status.key === undefined) throw new Error(`status key should be defined`)
if (typeof status.key === 'string' && (!keys.includes(status.key))) {
throw new Error('key should contain either number or ' + keys.join())

@ -114,7 +114,7 @@ class CompileTab extends ViewPlugin {
if (success) {
// forwarding the event to the appManager infra
this.emit('compilationFinished', source.target, source, 'soljson', data)
if (data.errors) {
if (data.errors && data.errors.length > 0) {
this.emit('statusChanged', {
key: data.errors.length,
title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`,

Loading…
Cancel
Save