From 7172fe912ab087328bb25af92793798ab0ee4034 Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman Date: Thu, 12 Sep 2024 10:56:05 -0500 Subject: [PATCH 1/2] fix --- components/project/traces/trace-sheet.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/project/traces/trace-sheet.tsx b/components/project/traces/trace-sheet.tsx index fe31fe5d..65118359 100644 --- a/components/project/traces/trace-sheet.tsx +++ b/components/project/traces/trace-sheet.tsx @@ -55,14 +55,14 @@ export function TraceSheet({ const [span, setSpan] = useState(null); const [attributes, setAttributes] = useState(null); const [events, setEvents] = useState(null); - const [selectedData, setSelectedData] = useState([]); + const [selectedData, setSelectedData] = useState(null); useEffect(() => { setSelectedTrace(trace.trace_hierarchy); setSelectedVendors(trace.vendors); if (trace.vendors.includes("langgraph")) setIncludesLanggraph(true); if (!open) { - setSelectedData([]); + setSelectedData(null); setSpansView("SPANS"); } }, [trace, open]); @@ -115,7 +115,7 @@ export function TraceSheet({ input, output, }; - setSelectedData((prev) => [...prev, checkedData]); + setSelectedData(checkedData); } }, [span]); @@ -160,10 +160,11 @@ export function TraceSheet({
data.input || data.output) + selectedData === null || + (selectedData.input === "" && + selectedData.output === "") } />