Revert "fix: SQL Lab show "Refetch Results" button while fetching new query results (#15109)" (#15301)

This reverts commit 408d58f937.
This commit is contained in:
Grace Guo 2021-06-22 11:08:29 -07:00 committed by GitHub
parent ab153e66cc
commit 5b2eb8d933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 14 deletions

View File

@ -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;
}
});