diff --git a/client/modules/IDE/components/Editor.js b/client/modules/IDE/components/Editor.js index 1f82fa22..874245ac 100644 --- a/client/modules/IDE/components/Editor.js +++ b/client/modules/IDE/components/Editor.js @@ -92,7 +92,9 @@ class Editor extends React.Component { if (this.props.file.content !== prevProps.file.content && this.props.file.content !== this._cm.getValue()) { 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) { this._cm.getWrapperElement().style['font-size'] = `${this.props.fontSize}px`; diff --git a/client/modules/IDE/pages/IDEView.js b/client/modules/IDE/pages/IDEView.js index 92be34c1..cacaa2fe 100644 --- a/client/modules/IDE/pages/IDEView.js +++ b/client/modules/IDE/pages/IDEView.js @@ -294,6 +294,7 @@ class IDEView extends React.Component { startRefreshSketch={this.props.startRefreshSketch} stopSketch={this.props.stopSketch} autorefresh={this.props.preferences.autorefresh} + unsavedChanges={this.props.ide.unsavedChanges} />