From 91f1a1dfd1584784c4b32652b72a17129ddf3511 Mon Sep 17 00:00:00 2001 From: Nikaru Date: Mon, 11 Nov 2024 10:38:31 +0000 Subject: [PATCH] fix: fix tooltip issue on switch tab in home chart --- components/home/ChartBox/Chart.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/home/ChartBox/Chart.tsx b/components/home/ChartBox/Chart.tsx index ce8835c..2e9232b 100644 --- a/components/home/ChartBox/Chart.tsx +++ b/components/home/ChartBox/Chart.tsx @@ -161,14 +161,14 @@ const Chart = (props: ChartProps) => { {currentPeriod && prevPeriod ? (
- {currentPeriod && ( + {currentPeriod.length > 0 && (
Current: {AmountConverter( - tooltipData.datumByKey[currentPeriodKey].datum + tooltipData.datumByKey[currentPeriodKey]?.datum .count, )} @@ -181,7 +181,7 @@ const Chart = (props: ChartProps) => { Previous: {AmountConverter( - tooltipData.datumByKey[prevPeriodKey].datum.count, + tooltipData.datumByKey[prevPeriodKey]?.datum.count, )}