From 1cecc7f9b555392674bf7f15c0473d8da0002aba Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Tue, 19 Jan 2021 10:47:40 +0100 Subject: [PATCH] Clears errors after running new query (#30367) --- public/app/features/explore/Explore.tsx | 3 ++- .../app/features/explore/__snapshots__/Explore.test.tsx.snap | 4 +--- public/app/features/explore/state/query.ts | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index d03bb3ab11f..4e4a569d8e2 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -312,7 +312,8 @@ export class Explore extends React.PureComponent { const isLoading = queryResponse.state === LoadingState.Loading; // gets an error without a refID, so non-query-row-related error, like a connection error - const queryErrors = queryResponse.error ? [queryResponse.error] : undefined; + const queryErrors = + queryResponse.state === LoadingState.Error && queryResponse.error ? [queryResponse.error] : undefined; const queryError = getFirstNonQueryRowSpecificError(queryErrors); const showRichHistory = openDrawer === ExploreDrawer.RichHistory; diff --git a/public/app/features/explore/__snapshots__/Explore.test.tsx.snap b/public/app/features/explore/__snapshots__/Explore.test.tsx.snap index 1b67a99f918..501de41bab2 100644 --- a/public/app/features/explore/__snapshots__/Explore.test.tsx.snap +++ b/public/app/features/explore/__snapshots__/Explore.test.tsx.snap @@ -37,9 +37,7 @@ exports[`Explore should render component 1`] = ` richHistoryButtonActive={false} /> - +