From dc05be36a60237c930ca60184bbbc054182eeab1 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 22 Feb 2017 16:26:17 -0800 Subject: [PATCH] Check if the query is in state first. (#2226) --- superset/assets/javascripts/SqlLab/reducers.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/superset/assets/javascripts/SqlLab/reducers.js b/superset/assets/javascripts/SqlLab/reducers.js index 04a7e525dccec..e6eb073ce6579 100644 --- a/superset/assets/javascripts/SqlLab/reducers.js +++ b/superset/assets/javascripts/SqlLab/reducers.js @@ -242,10 +242,9 @@ export const sqlLabReducer = function (state, action) { let change = false; for (const id in action.alteredQueries) { const changedQuery = action.alteredQueries[id]; - if ( - state.queries[id].state !== 'stopped' && - (!state.queries.hasOwnProperty(id) || - state.queries[id].changedOn !== changedQuery.changedOn)) { + if (!state.queries.hasOwnProperty(id) || + (state.queries[id].changedOn !== changedQuery.changedOn && + state.queries[id].state !== 'stopped')) { newQueries[id] = Object.assign({}, state.queries[id], changedQuery); change = true; }