diff --git a/embark-ui/src/components/Console.js b/embark-ui/src/components/Console.js index 4af70e1a6..8417c80d3 100644 --- a/embark-ui/src/components/Console.js +++ b/embark-ui/src/components/Console.js @@ -57,6 +57,15 @@ class Console extends Component { ) } + isJsonObject(item) { + if (!item.result) return false; + try { + return typeof(JSON.parse(item.result)) === 'object' + } catch(_err) { + return false; + } + } + renderTabs() { const {processLogs, processes} = this.props; @@ -70,7 +79,7 @@ class Console extends Component { .reverse() .map((item, i) => { - if (item.result && (item.result[0] === "{" || item.result[0] === "[")) { + if (this.isJsonObject(item)) { return(