Unverified Commit 99db93c8 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #2292 from ethereum/statusUpdate

check for key is defined
parents bb355c6b 2def63cc
...@@ -48,7 +48,7 @@ export class VerticalIcons extends Plugin { ...@@ -48,7 +48,7 @@ export class VerticalIcons extends Plugin {
const types = ['error', 'warning', 'success', 'info', ''] const types = ['error', 'warning', 'success', 'info', '']
const fn = (status) => { const fn = (status) => {
if (!types.includes(status.type) && status.type) throw new Error(`type should be ${keys.join()}`) 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))) { if (typeof status.key === 'string' && (!keys.includes(status.key))) {
throw new Error('key should contain either number or ' + keys.join()) throw new Error('key should contain either number or ' + keys.join())
......
...@@ -114,7 +114,7 @@ class CompileTab extends ViewPlugin { ...@@ -114,7 +114,7 @@ class CompileTab extends ViewPlugin {
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) this.emit('compilationFinished', source.target, source, 'soljson', data)
if (data.errors) { if (data.errors && data.errors.length > 0) {
this.emit('statusChanged', { this.emit('statusChanged', {
key: data.errors.length, key: data.errors.length,
title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`, title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`,
......
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