From b733e37e77dbcb823df52c7c9fefc851156bee08 Mon Sep 17 00:00:00 2001 From: brightiron Date: Fri, 5 Jul 2024 08:53:02 -0500 Subject: [PATCH] index resets at 99. account for this --- src/views/Range/hooks.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Range/hooks.tsx b/src/views/Range/hooks.tsx index 42369a53c..e888226c0 100644 --- a/src/views/Range/hooks.tsx +++ b/src/views/Range/hooks.tsx @@ -33,7 +33,7 @@ export const PriceHistory = () => { const contract = RANGE_PRICE_CONTRACT.getEthersContract(networks.MAINNET); const lastObservationIndex = await contract.nextObsIndex(); const secondsToSubtract = await contract.observationFrequency(); - const totalObservations = 10; + const totalObservations = lastObservationIndex < 10 ? lastObservationIndex : 10; let currentDate = new Date(); // Start with the current date const resultsArray: { price: number;