From f4c3c5f0e8cf8130f0c4b299475473c1b389473a Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Thu, 26 Aug 2021 13:31:49 +0200 Subject: [PATCH] [ML] Fix loading spinner of latency correlations chart when cancel was hit before retrieving any data. --- .../hooks/use_transaction_latency_correlations_fetcher.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts index d96ef9637ffef..0b035c6af2354 100644 --- a/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts +++ b/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts @@ -149,6 +149,11 @@ export const useTransactionLatencyCorrelationsFetcher = () => { abortCtrl.current.abort(); setFetchState((prevState) => ({ ...prevState, + // If we didn't receive data for the overall histogram yet + // set it to an empty array to indicate loading stopped. + ...(prevState.overallHistogram === undefined + ? { overallHistogram: [] } + : {}), isRunning: false, })); }, [setFetchState]);