Skip to content

Commit

Permalink
Revert "fix: SQL Lab show "Refetch Results" button while fetching new…
Browse files Browse the repository at this point in the history
… query results (apache#15109)" (apache#15301)

This reverts commit 408d58f.
  • Loading branch information
Grace Guo authored and cccs-RyanS committed Dec 17, 2021
1 parent 0d63422 commit fb4d648
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions superset-frontend/src/SqlLab/reducers/sqlLab.js
Expand Up @@ -517,20 +517,7 @@ export default function sqlLabReducer(state = {}, action) {
if (changedQuery.changedOn > queriesLastUpdate) {
queriesLastUpdate = changedQuery.changedOn;
}
const prevState = state.queries[id].state;
const currentState = changedQuery.state;
newQueries[id] = {
...state.queries[id],
...changedQuery,
// race condition:
// because of async behavior, sql lab may still poll a couple of seconds
// when it started fetching or finished rendering results
state:
currentState === 'success' &&
['fetching', 'success'].includes(prevState)
? prevState
: currentState,
};
newQueries[id] = { ...state.queries[id], ...changedQuery };
change = true;
}
});
Expand Down

0 comments on commit fb4d648

Please sign in to comment.