Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ class ExploreViewContainer extends React.Component {
}

componentDidMount() {
this.props.actions.fetchDatasources();
if (!this.props.standalone) {
this.props.actions.fetchDatasources();
}
window.addEventListener('resize', this.handleResize.bind(this));
this.triggerQueryIfNeeded();
}

componentWillReceiveProps(np) {
Expand All @@ -47,9 +50,7 @@ class ExploreViewContainer extends React.Component {
}

componentDidUpdate() {
if (this.props.triggerQuery && !this.hasErrors()) {
this.runQuery();
}
this.triggerQueryIfNeeded();
}

componentWillUnmount() {
Expand All @@ -61,7 +62,8 @@ class ExploreViewContainer extends React.Component {
this.props.actions.removeControlPanelAlert();
this.props.actions.removeChartAlert();

this.runQuery();
this.props.actions.triggerQuery();
Copy link
Copy Markdown

@ascott ascott Apr 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, why do we triggerQuery before unmount?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on this is onQuery, it just looks like it's componentWillUnmount because of the way Github folded the code...


history.pushState(
{},
document.title,
Expand All @@ -81,8 +83,10 @@ class ExploreViewContainer extends React.Component {
}


runQuery() {
this.props.actions.runQuery(this.props.form_data);
triggerQueryIfNeeded() {
if (this.props.triggerQuery && !this.hasErrors()) {
this.props.actions.runQuery(this.props.form_data);
}
}

handleResize() {
Expand Down