fixes #134
This commit is contained in:
parent
d8ad4849e4
commit
37bb45cc37
2 changed files with 4 additions and 2 deletions
|
@ -27,6 +27,7 @@ class Console extends React.Component {
|
||||||
if (nextProps.isPlaying && !this.props.isPlaying) {
|
if (nextProps.isPlaying && !this.props.isPlaying) {
|
||||||
this.children = [];
|
this.children = [];
|
||||||
} else if (nextProps.consoleEvent !== this.props.consoleEvent && this.props.isPlaying) {
|
} else if (nextProps.consoleEvent !== this.props.consoleEvent && this.props.isPlaying) {
|
||||||
|
console.log(nextProps.consoleEvent);
|
||||||
nextProps.consoleEvent.forEach(consoleEvent => {
|
nextProps.consoleEvent.forEach(consoleEvent => {
|
||||||
if (consoleEvent.source === 'sketch') {
|
if (consoleEvent.source === 'sketch') {
|
||||||
const args = consoleEvent.arguments;
|
const args = consoleEvent.arguments;
|
||||||
|
|
|
@ -101,11 +101,12 @@ function hijackConsoleErrorsScript(offs) {
|
||||||
var fileInfo = getScriptOff(lineNumber);
|
var fileInfo = getScriptOff(lineNumber);
|
||||||
data = msg + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')';
|
data = msg + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')';
|
||||||
}
|
}
|
||||||
window.parent.postMessage({
|
|
||||||
|
window.parent.postMessage([{
|
||||||
method: 'error',
|
method: 'error',
|
||||||
arguments: data,
|
arguments: data,
|
||||||
source: 'sketch'
|
source: 'sketch'
|
||||||
}, '*');
|
}], '*');
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
</script>`;
|
</script>`;
|
||||||
|
|
Loading…
Reference in a new issue