Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(ui): invalidation of traces when deleting a single trace (#1134)

Marc Klingen78df145e205d
diff --git a/src/components/delete-trace.tsx b/src/components/delete-trace.tsx
index 5cc484d35c..c200e9a157 100644
--- a/src/components/delete-trace.tsx
+++ b/src/components/delete-trace.tsx
@@ -30,13 +30,11 @@ export function DeleteTrace({
const mutDeleteTraces = api.traces.deleteMany.useMutation({
onSuccess: () => {
setIsDeleted(true);
- if (!isTableAction) {
- void router
- .push(`/project/${projectId}/traces`)
- .then(() => utils.traces.invalidate());
- } else {
- void utils.traces.invalidate();
- }
+ void utils.traces.invalidate().then(() => {
+ if (!isTableAction) {
+ void router.push(`/project/${projectId}/traces`);
+ }
+ });
},
});