This commit is contained in:
Cassie Tarakajian 2016-11-08 13:30:41 -05:00
parent c7483b5d3a
commit 77e2f5bfff
2 changed files with 4 additions and 1 deletions

View file

@ -92,7 +92,9 @@ class Editor extends React.Component {
if (this.props.file.content !== prevProps.file.content && if (this.props.file.content !== prevProps.file.content &&
this.props.file.content !== this._cm.getValue()) { this.props.file.content !== this._cm.getValue()) {
this._cm.setValue(this.props.file.content); // eslint-disable-line no-underscore-dangle this._cm.setValue(this.props.file.content); // eslint-disable-line no-underscore-dangle
setTimeout(() => this.props.setUnsavedChanges(false), 500); if (!prevProps.unsavedChanges) {
setTimeout(() => this.props.setUnsavedChanges(false), 400);
}
} }
if (this.props.fontSize !== prevProps.fontSize) { if (this.props.fontSize !== prevProps.fontSize) {
this._cm.getWrapperElement().style['font-size'] = `${this.props.fontSize}px`; this._cm.getWrapperElement().style['font-size'] = `${this.props.fontSize}px`;

View file

@ -294,6 +294,7 @@ class IDEView extends React.Component {
startRefreshSketch={this.props.startRefreshSketch} startRefreshSketch={this.props.startRefreshSketch}
stopSketch={this.props.stopSketch} stopSketch={this.props.stopSketch}
autorefresh={this.props.preferences.autorefresh} autorefresh={this.props.preferences.autorefresh}
unsavedChanges={this.props.ide.unsavedChanges}
/> />
<Console <Console
consoleEvent={this.props.ide.consoleEvent} consoleEvent={this.props.ide.consoleEvent}