From b2d53dbe91ba99f0062b8c772797a9b8149afcd2 Mon Sep 17 00:00:00 2001 From: t0rbik Date: Wed, 27 Nov 2024 12:25:07 +0100 Subject: [PATCH] fix initial render of apy graph throwing error, when the width is 0 --- src/components/vaults/row/AprHistoricalChart.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/vaults/row/AprHistoricalChart.tsx b/src/components/vaults/row/AprHistoricalChart.tsx index ee1544f7..eec86644 100644 --- a/src/components/vaults/row/AprHistoricalChart.tsx +++ b/src/components/vaults/row/AprHistoricalChart.tsx @@ -120,6 +120,7 @@ const AprHistoricalGraph = ({ width, height, data }: AreaProps) => { const avg = data.reduce((acc, cur) => acc + cur.apr, 0) / data.length; + if (width === 0) return null; return ( <>