[sql lab] address lingering spinner in schema select (#2512)

This commit is contained in:
Maxime Beauchemin
2017-03-31 08:27:48 -07:00
committed by GitHub
parent abe79d1427
commit 513a090cdc

View File

@@ -32,8 +32,9 @@ class SqlEditorLeftBar extends React.PureComponent {
this.fetchTables(this.props.queryEditor.dbId, this.props.queryEditor.schema); this.fetchTables(this.props.queryEditor.dbId, this.props.queryEditor.schema);
} }
onChange(db) { onChange(db) {
const val = (db) ? db.value : null; const val = db ? db.value : null;
this.setState({ schemaOptions: [] }); this.setState({ schemaOptions: [] });
this.props.actions.queryEditorSetSchema(this.props.queryEditor, null);
this.props.actions.queryEditorSetDb(this.props.queryEditor, val); this.props.actions.queryEditorSetDb(this.props.queryEditor, val);
if (!(db)) { if (!(db)) {
this.setState({ tableOptions: [] }); this.setState({ tableOptions: [] });