fix #284, when autorefresh is enabled, clear the console as well

This commit is contained in:
Cassie Tarakajian 2017-02-17 16:04:47 -05:00
parent 7b602671b9
commit 93e0ec2a73
2 changed files with 4 additions and 1 deletions

View file

@ -84,6 +84,7 @@ class Editor extends React.Component {
this.props.updateFileContent(this.props.file.name, this._cm.getValue()); this.props.updateFileContent(this.props.file.name, this._cm.getValue());
if (this.props.autorefresh && this.props.isPlaying) { if (this.props.autorefresh && this.props.isPlaying) {
this.props.startRefreshSketch(); this.props.startRefreshSketch();
this.props.clearConsole();
} }
}, 400)); }, 400));
@ -296,7 +297,8 @@ Editor.propTypes = {
isExpanded: PropTypes.bool.isRequired, isExpanded: PropTypes.bool.isRequired,
collapseSidebar: PropTypes.func.isRequired, collapseSidebar: PropTypes.func.isRequired,
expandSidebar: PropTypes.func.isRequired, expandSidebar: PropTypes.func.isRequired,
isUserOwner: PropTypes.bool isUserOwner: PropTypes.bool,
clearConsole: PropTypes.func.isRequired
}; };
export default Editor; export default Editor;

View file

@ -313,6 +313,7 @@ class IDEView extends React.Component {
expandSidebar={this.props.expandSidebar} expandSidebar={this.props.expandSidebar}
collapseSidebar={this.props.collapseSidebar} collapseSidebar={this.props.collapseSidebar}
isUserOwner={this.isUserOwner()} isUserOwner={this.isUserOwner()}
clearConsole={this.props.clearConsole}
/> />
<Console <Console
consoleEvents={this.props.console} consoleEvents={this.props.console}