From 65add772ea6aa92849171704b85603083cd48690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Sat, 21 Mar 2020 00:37:53 +0100 Subject: [PATCH] [APM] service maps: avoid unnecesary `useDeepObjectIdentity` --- .../components/app/ServiceMap/index.tsx | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx index 7040c27765a8db..65523411176ab6 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx @@ -28,33 +28,27 @@ interface ServiceMapProps { export function ServiceMap({ serviceName }: ServiceMapProps) { const license = useLicense(); const { urlParams, uiFilters } = useUrlParams(); - const params = useDeepObjectIdentity({ - start: urlParams.start, - end: urlParams.end, - environment: urlParams.environment, - serviceName, - uiFilters: { - ...uiFilters, - environment: undefined - } - }); const { data } = useFetcher(() => { - const { start, end } = params; + const { start, end, environment } = urlParams; if (start && end) { return callApmApi({ pathname: '/api/apm/service-map', params: { query: { - ...params, start, end, - uiFilters: JSON.stringify(params.uiFilters) + environment, + serviceName, + uiFilters: JSON.stringify({ + ...uiFilters, + environment: undefined + }) } } }); } - }, [params]); + }, [serviceName, uiFilters, urlParams]); const { ref, height, width } = useRefDimensions();