From a70058cf5d8f2ecb2c29afa6dd7598d8dd1be98d Mon Sep 17 00:00:00 2001 From: sylenien Date: Wed, 10 Aug 2022 17:59:54 +0200 Subject: [PATCH] fix(ui): fix crashes --- .../components/DashboardList/DashboardListItem.tsx | 2 +- .../Dashboard/components/DashboardWidgetGrid/AddMetric.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/Dashboard/components/DashboardList/DashboardListItem.tsx b/frontend/app/components/Dashboard/components/DashboardList/DashboardListItem.tsx index 5e82ac2b6..1fffe9f30 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/DashboardListItem.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/DashboardListItem.tsx @@ -51,5 +51,5 @@ function DashboardListItem(props: Props) { ); } - +// @ts-ignore export default connect(state => ({ siteId: state.getIn([ 'site', 'siteId' ]) }))(withRouter(DashboardListItem)) diff --git a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetric.tsx b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetric.tsx index ccdc033fe..af46de0c2 100644 --- a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetric.tsx +++ b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/AddMetric.tsx @@ -67,7 +67,7 @@ function AddMetric({ metrics, history, siteId, title, description }: IProps) {
- {metrics.map((metric: any) => ( + {metrics ? metrics.map((metric: any) => ( dashboardStore.toggleWidgetSelection(metric)} /> - ))} + )) : ( +
No custom metrics created.
+ )}