From d2d47024dd3c0415c2a15b4a518f99583e8e1d6c Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Fri, 29 Nov 2024 11:53:37 +0100 Subject: [PATCH] fix last graph timestamp to match between periods --- .../Portfolio/common/hooks/useGetPortfolioTokenChart.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts index a745475dcd..83aa0ae562 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts @@ -45,7 +45,9 @@ const getTimestamps = (timeInterval: TokenChartInterval) => { }[timeInterval ?? TokenChartInterval.DAY] const step = (now - from) / resolution - return Array.from({length: resolution}, (_, i) => from + Math.round(step * i)) + const spread = Array.from({length: resolution}, (_, i) => from + Math.round(step * i)) + spread.push(now) + return spread } const ptTicker = networkConfigs[Chain.Network.Mainnet].primaryTokenInfo.ticker