Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikscale3 committed Sep 12, 2024
1 parent 3b5c063 commit 38168b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions components/project/traces/trace-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export function TraceSheet({
const [span, setSpan] = useState<any | null>(null);
const [attributes, setAttributes] = useState<any | null>(null);
const [events, setEvents] = useState<any | null>(null);
const [selectedData, setSelectedData] = useState<CheckedData[]>([]);
const [selectedData, setSelectedData] = useState<CheckedData | null>(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]);
Expand Down Expand Up @@ -115,7 +115,7 @@ export function TraceSheet({
input,
output,
};
setSelectedData((prev) => [...prev, checkedData]);
setSelectedData(checkedData);
}
}, [span]);

Expand Down Expand Up @@ -160,10 +160,11 @@ export function TraceSheet({
<div className="flex gap-2 items-center">
<AddtoDataset
projectId={project_id}
selectedData={selectedData}
selectedData={selectedData ? [selectedData] : []}
disabled={
selectedData.length === 0 ||
!selectedData.every((data) => data.input || data.output)
selectedData === null ||
(selectedData.input === "" &&
selectedData.output === "")
}
/>
<Button
Expand Down

0 comments on commit 38168b6

Please sign in to comment.