Skip to content

Commit

Permalink
Disable GraphiQL tab until changes to SDL are saved
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 30, 2020
1 parent 140a0bc commit d9be647
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class FakeEditor extends React.Component<any, FakeEditorState> {

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

Expand All @@ -196,9 +196,9 @@ class FakeEditor extends React.Component<any, FakeEditorState> {
<EditIcon />{' '}
</li>
<li
onClick={() => this.state.schema && this.switchTab(1)}
onClick={() => !dirty && this.switchTab(1)}
className={classNames({
'-disabled': !this.state.schema,
'-disabled': dirty,
'-active': activeTab === 1,
})}
>
Expand Down

0 comments on commit d9be647

Please sign in to comment.