From c913c8bf208eb60f117b58020ccaffcaf4a71e31 Mon Sep 17 00:00:00 2001 From: Vikrant Gupta Date: Wed, 29 May 2024 18:59:15 +0530 Subject: [PATCH] fix: clone dashboard panel intermittent issue (#5096) --- .../GridCardLayout/GridCard/WidgetGraphComponent.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/container/GridCardLayout/GridCard/WidgetGraphComponent.tsx b/frontend/src/container/GridCardLayout/GridCard/WidgetGraphComponent.tsx index 0b47403224..269e648aee 100644 --- a/frontend/src/container/GridCardLayout/GridCard/WidgetGraphComponent.tsx +++ b/frontend/src/container/GridCardLayout/GridCard/WidgetGraphComponent.tsx @@ -160,7 +160,11 @@ function WidgetGraphComponent({ }, }, { - onSuccess: () => { + onSuccess: (updatedDashboard) => { + if (setLayouts) setLayouts(updatedDashboard.payload?.data?.layout || []); + if (setSelectedDashboard && updatedDashboard.payload) { + setSelectedDashboard(updatedDashboard.payload); + } notifications.success({ message: 'Panel cloned successfully, redirecting to new copy.', });