Skip to content

Commit

Permalink
Flush data and query in results when running new query, keeping columns
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu committed Dec 1, 2016
1 parent 415a62b commit 243d7f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/assets/javascripts/SqlLab/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export const sqlLabReducer = function (state, action) {
if (action.query.sqlEditorId) {
const qe = getFromArr(state.queryEditors, action.query.sqlEditorId);
if (qe.latestQueryId) {
const q = Object.assign({}, state.queries[qe.latestQueryId], { results: null });
const newResults = Object.assign(
{}, state.queries[qe.latestQueryId].results, { data: [], query: null });
const q = Object.assign({}, state.queries[qe.latestQueryId], { results: newResults });
const queries = Object.assign({}, state.queries, { [q.id]: q });
newState = Object.assign({}, state, { queries });
}
Expand Down

0 comments on commit 243d7f6

Please sign in to comment.