diff --git a/frontend/pages/dashboard/[dashboardId].js b/frontend/pages/dashboard/[dashboardId].js index 878a5e0c..629f2d1a 100644 --- a/frontend/pages/dashboard/[dashboardId].js +++ b/frontend/pages/dashboard/[dashboardId].js @@ -178,7 +178,7 @@ const Analytics = () => { <> - {Object.keys(dashboardLinksCache.data.data).map((key) => { + {Object.keys(dashboardLinksCache.data.data)?.map((key) => { const s3PresignedURLs = dashboardLinksCache.data.data[key]; const name = subscriptionsCache.data.subscriptions.find( (subscription) => subscription.id === key diff --git a/frontend/src/components/Report.js b/frontend/src/components/Report.js index 87f43a41..2111e888 100644 --- a/frontend/src/components/Report.js +++ b/frontend/src/components/Report.js @@ -2,6 +2,7 @@ import React from "react"; import { ResponsiveLineCanvas } from "@nivo/line"; const Report = ({ data, timeRange }) => { + if (!data) return "there is no data to show"; const commonProperties = { animate: false, enableSlices: "x", diff --git a/frontend/src/components/SubscriptionReport.js b/frontend/src/components/SubscriptionReport.js index fa6b17ca..2bfd0f1a 100644 --- a/frontend/src/components/SubscriptionReport.js +++ b/frontend/src/components/SubscriptionReport.js @@ -114,7 +114,7 @@ const SubscriptionReport = ({ flexWrap="wrap" alignContent={["inherit", "flex-start", null]} > - {data?.web3_metric.map((metric, web3MetricIndex) => { + {data?.web3_metric?.map((metric, web3MetricIndex) => { return (