From 0b999aa7bfe675da7041218e1bc8f2716ecfc753 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 15 Apr 2022 16:54:29 +0200 Subject: [PATCH] fix(ui) - widget remove fix id null --- .../Dashboard/components/WidgetWrapper/WidgetWrapper.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx index 8f58e6691..dbca839e9 100644 --- a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx +++ b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx @@ -32,6 +32,7 @@ function WidgetWrapper(props: Props) { const { isWidget = false, active = false, index = 0, moveListItem = null, isPreview = false, isTemplate = false, dashboardId, siteId } = props; const widget: any = useObserver(() => props.widget); const isPredefined = widget.metricType === 'predefined'; + const dashboard = useObserver(() => dashboardStore.selectedDashboard); const [{ opacity, isDragging }, dragRef] = useDrag({ type: 'item', @@ -55,7 +56,7 @@ function WidgetWrapper(props: Props) { }) const onDelete = async () => { - dashboardStore.deleteDashboardWidget(dashboardId!, widget.widgetId); + dashboardStore.deleteDashboardWidget(dashboard?.dashboardId, widget.widgetId); // if (await confirm({ // header: 'Confirm', // confirmButton: 'Yes, delete',