From 7b9fa9f4a732a94552e9951aaaf7b0e9cdda393b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 6 Dec 2017 08:40:43 -0800 Subject: [PATCH] Fixed: Spurious save prompts --- app/components/Editor/Editor.js | 5 +---- app/scenes/Document/Document.js | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/components/Editor/Editor.js b/app/components/Editor/Editor.js index a95079ff7..5edfd4d31 100644 --- a/app/components/Editor/Editor.js +++ b/app/components/Editor/Editor.js @@ -76,10 +76,7 @@ class MarkdownEditor extends Component { onChange = (change: Change) => { if (this.editorValue !== change.value) { - const text = Markdown.serialize(change.value); - if (text !== this.props.text) { - this.props.onChange(text); - } + this.props.onChange(Markdown.serialize(change.value)); this.editorValue = change.value; } }; diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index f116a909c..0f2d3a21f 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -183,6 +183,7 @@ class DocumentScene extends Component { onChange = text => { if (!this.document) return; + if (this.document.text === text) return; this.document.updateData({ text }, true); };