Skip to content

Commit

Permalink
only show the reset state button if location param (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alanna Scott authored Sep 8, 2016
1 parent 0e0eaa0 commit 8eb4cbf
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class SqlEditorTopToolbar extends React.Component {
}
render() {
const tables = this.props.tables.filter((t) => (t.queryEditorId === this.props.queryEditor.id));
const shouldShowReset = window.location.search === '?reset=1';
return (
<div className="clearfix sql-toolbar">
<div>
Expand Down Expand Up @@ -159,9 +160,11 @@ class SqlEditorTopToolbar extends React.Component {
<TableElement table={table} queryEditor={this.props.queryEditor} />
))}
</div>
<Button bsSize="small" bsStyle="danger" onClick={this.resetState.bind(this)}>
<i className="fa fa-bomb" /> Reset State
</Button>
{shouldShowReset &&
<Button bsSize="small" bsStyle="danger" onClick={this.resetState.bind(this)}>
<i className="fa fa-bomb" /> Reset State
</Button>
}
</div>
);
}
Expand Down

0 comments on commit 8eb4cbf

Please sign in to comment.