fix: clone dashboard panel intermittent issue (#5096)

This commit is contained in:
Vikrant Gupta 2024-05-29 18:59:15 +05:30 committed by GitHub
parent 1328f05d78
commit c913c8bf20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.',
});