Skip to content

Commit

Permalink
Fix issue where Ctrl-Z on editor always resulted in empty editor
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 30, 2020
1 parent b0c86cf commit 140a0bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ class FakeEditor extends React.Component<any, FakeEditorState> {

render() {
let { value, activeTab, schema, dirty, dirtySchema } = this.state;
if (value == null) {
return <div className="faker-editor-container">Loading...</div>;
}

return (
<div className="faker-editor-container">
<nav>
Expand Down Expand Up @@ -219,7 +223,7 @@ class FakeEditor extends React.Component<any, FakeEditorState> {
schema={dirtySchema || schema}
onEdit={this.onEdit}
onCommand={this.saveUserSDL}
value={value || ''}
value={value}
/>
<div className="action-panel">
<a
Expand Down

0 comments on commit 140a0bc

Please sign in to comment.