diff --git a/public/components/trace_analytics/components/common/plots/service_map.tsx b/public/components/trace_analytics/components/common/plots/service_map.tsx index a5bb0b7e1..e33b9bb09 100644 --- a/public/components/trace_analytics/components/common/plots/service_map.tsx +++ b/public/components/trace_analytics/components/common/plots/service_map.tsx @@ -84,9 +84,7 @@ export function ServiceMap({ includeMetricsCallback?: () => void; mode?: string; filters: FilterType[]; - setFilters: - | React.Dispatch> - | ((filters: FilterType[]) => void); + setFilters: (filters: FilterType[]) => void; hideSearchBar?: boolean; }) { const [graphKey, setGraphKey] = useState(0); // adding key to allow for re-renders diff --git a/public/components/trace_analytics/components/services/service_view.tsx b/public/components/trace_analytics/components/services/service_view.tsx index a95b023b1..2ca6d2333 100644 --- a/public/components/trace_analytics/components/services/service_view.tsx +++ b/public/components/trace_analytics/components/services/service_view.tsx @@ -76,16 +76,18 @@ export function ServiceView(props: ServiceViewProps) { >('latency'); const [redirect, setRedirect] = useState(false); const [actionsMenuPopover, setActionsMenuPopover] = useState(false); + const [serviceId, setServiceId] = useState(null); + const location = useLocation(); - let serviceId: string | null = null; - - try { - const location = useLocation(); - const params = new URLSearchParams(location?.search || ''); - serviceId = params.get('serviceId'); - } catch (error) { - serviceId = null; - } + useEffect(() => { + try { + const params = new URLSearchParams(location?.search || ''); + const id = params.get('serviceId'); + setServiceId(id); + } catch (error) { + setServiceId(null); + } + }, [location]); const hideSearchBarCheck = page === 'serviceFlyout' || serviceId !== ''; diff --git a/public/components/trace_analytics/home.tsx b/public/components/trace_analytics/home.tsx index d107bfe2d..ccdb45c39 100644 --- a/public/components/trace_analytics/home.tsx +++ b/public/components/trace_analytics/home.tsx @@ -490,9 +490,9 @@ export const Home = (props: HomeProps) => { }} /> } /> + {flyout} + {spanFlyoutComponent} - {flyout} - {spanFlyoutComponent} ); };