Explore: Don't change query status to Done if there was Error (#43850)

This commit is contained in:
Andrej Ocenas 2022-01-10 13:44:51 +01:00 committed by GitHub
parent 1141df7b9b
commit dcd4e74c54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -471,7 +471,12 @@ export const runQueries = (
console.error(error);
},
complete() {
dispatch(changeLoadingStateAction({ exploreId, loadingState: LoadingState.Done }));
// In case we don't get any response at all but the observable completed, make sure we stop loading state.
// This is for cases when some queries are noop like running first query after load but we don't have any
// actual query input.
if (getState().explore[exploreId]!.queryResponse.state === LoadingState.Loading) {
dispatch(changeLoadingStateAction({ exploreId, loadingState: LoadingState.Done }));
}
},
});