From dc8e30c7416b35b4d09e079bf3ace93e9a65a855 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Fri, 6 Dec 2024 13:48:40 -0800 Subject: [PATCH] add missing format change Signed-off-by: Adam Tackett --- .../components/traces/span_detail_panel.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/public/components/trace_analytics/components/traces/span_detail_panel.tsx b/public/components/trace_analytics/components/traces/span_detail_panel.tsx index 2a2b1276b..09ad0b480 100644 --- a/public/components/trace_analytics/components/traces/span_detail_panel.tsx +++ b/public/components/trace_analytics/components/traces/span_detail_panel.tsx @@ -50,16 +50,17 @@ export function SpanDetailPanel(props: { storedFilters ? JSON.parse(storedFilters) : [] ); const [DSL, setDSL] = useState({}); - let data: { gantt: any[]; table: any[]; ganttMaxX: number }, - setData: (data: { gantt: any[]; table: any[]; ganttMaxX: number }) => void; + let data: { gantt: any[]; table: any[]; ganttMaxX: number }; + let setData: (data: { gantt: any[]; table: any[]; ganttMaxX: number }) => void; + const [localData, localSetData] = useState<{ gantt: any[]; table: any[]; ganttMaxX: number }>({ + gantt: [], + table: [], + ganttMaxX: 0, + }); if (props.data && props.setData) { [data, setData] = [props.data, props.setData]; } else { - [data, setData] = useState<{ gantt: any[]; table: any[]; ganttMaxX: number }>({ - gantt: [], - table: [], - ganttMaxX: 0, - }); + [data, setData] = [localData, localSetData]; } const fullRange = [0, data.ganttMaxX * 1.1]; const [selectedRange, setSelectedRange] = useState(fullRange);