From d1170d3cef01be1154540cce30f798f851ca927e Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Sun, 28 Oct 2018 11:21:05 +0100 Subject: [PATCH] Reset content if empty --- embark-ui/src/components/TextEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embark-ui/src/components/TextEditor.js b/embark-ui/src/components/TextEditor.js index 9dc01e22..5f5ff814 100644 --- a/embark-ui/src/components/TextEditor.js +++ b/embark-ui/src/components/TextEditor.js @@ -120,8 +120,8 @@ class TextEditor extends React.Component { } componentDidUpdate(prevProps) { - if (this.props.currentFile.content && this.props.currentFile.content !== prevProps.currentFile.content) { - editor.setValue(this.props.currentFile.content); + if (this.props.currentFile.content !== prevProps.currentFile.content) { + editor.setValue(this.props.currentFile.content || ''); } this.updateMarkers();