Merge pull request #175 from status-im/bugfix/close-content-when-no-file

Reset content if empty
This commit is contained in:
Iuri Matias 2018-10-28 11:28:42 +01:00 committed by GitHub
commit 1a60f0f718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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();