Skip to content

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

fix(dashboard): persist filters after saving by invalidating tRPC state (#10206)

Aman Thakur72eaaf69a652
diff --git a/web/src/pages/project/[projectId]/widgets/[widgetId]/index.tsx b/web/src/pages/project/[projectId]/widgets/[widgetId]/index.tsx
index 37a4df3226..d1059484ca 100644
--- a/web/src/pages/project/[projectId]/widgets/[widgetId]/index.tsx
+++ b/web/src/pages/project/[projectId]/widgets/[widgetId]/index.tsx
@@ -18,6 +18,7 @@ export default function EditWidget() {
};
// Fetch the widget details
+ const utils = api.useUtils();
const { data: widgetData, isLoading: isWidgetLoading } =
api.dashboardWidgets.get.useQuery(
{
@@ -31,6 +32,9 @@ export default function EditWidget() {
// Update widget mutation
const updateWidgetMutation = api.dashboardWidgets.update.useMutation({
+ onSettled: () => {
+ utils.dashboardWidgets.invalidate();
+ },
onSuccess: () => {
showSuccessToast({
title: "Widget updated successfully",