Skip to content

Commit

Permalink
[Explore] Fix Stop Query Button behavior (#4301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo authored Jan 31, 2018
1 parent c77bab8 commit 1a7ef47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions superset/assets/javascripts/chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export function chartUpdateSucceeded(queryResponse, key) {
}

export const CHART_UPDATE_STOPPED = 'CHART_UPDATE_STOPPED';
export function chartUpdateStopped(queryRequest, key) {
if (queryRequest) {
queryRequest.abort();
}
export function chartUpdateStopped(key) {
return { type: CHART_UPDATE_STOPPED, key };
}

Expand Down Expand Up @@ -146,7 +143,9 @@ export function runQuery(formData, force = false, timeout = 60, key) {
});
if (err.statusText === 'timeout') {
dispatch(chartUpdateTimeout(err.statusText, timeout, key));
} else if (err.statusText !== 'abort') {
} else if (err.statusText === 'abort') {
dispatch(chartUpdateStopped(key));
} else {
let errObject;
if (err.responseJSON) {
errObject = err.responseJSON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ExploreViewContainer extends React.Component {
}

onStop() {
this.props.actions.chartUpdateStopped(this.props.chart.queryRequest);
return this.props.chart.queryRequest.abort();
}

getWidth() {
Expand Down

0 comments on commit 1a7ef47

Please sign in to comment.