From dcd4e74c546bec0a6fd23845672574f51d9685a9 Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Mon, 10 Jan 2022 13:44:51 +0100 Subject: [PATCH] Explore: Don't change query status to Done if there was Error (#43850) --- public/app/features/explore/state/query.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/features/explore/state/query.ts b/public/app/features/explore/state/query.ts index e4eee245df3..f8b75a541c6 100644 --- a/public/app/features/explore/state/query.ts +++ b/public/app/features/explore/state/query.ts @@ -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 })); + } }, });