[sqllab] Fixed js error when results are not available (#1715)

* Fixed js error when results are not available

* Flush data and query in results when running new query, keeping columns

* add exception for columns

* Move setState from componentWillMount to componentWillReceiveProps

* Nit
This commit is contained in:
vera-liu
2016-12-05 13:36:18 -08:00
committed by GitHub
parent d8864bc92b
commit eb0655cf85
3 changed files with 23 additions and 14 deletions

View File

@@ -47,8 +47,7 @@ class QueryTable extends React.PureComponent {
this.setState({ showVisualizeModal: false });
}
showVisualizeModal(query) {
this.setState({ showVisualizeModal: true });
this.setState({ activeQuery: query });
this.setState({ activeQuery: query, showVisualizeModal: true });
}
restoreSql(query) {
this.props.actions.queryEditorSetSql({ id: query.sqlEditorId }, query.sql);