From ef95388185b2c99a002c452907aeaf6a2f614000 Mon Sep 17 00:00:00 2001 From: Emily Doherty Date: Thu, 24 Oct 2024 18:09:21 -0700 Subject: [PATCH] Fix live prices being added to the chart with incorrect price --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index aff109e..83091eb 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,7 @@ let currentRegionSelection = ''; let currentTimeSelection = ''; let currentAggregateSelection = ''; let startYAtZero = false; +let datum; let chart; const currentPriceHash = { us: 0, @@ -47,7 +48,7 @@ async function updateRegionalToken(region, data) { currentPriceHash[region] = data['price_data'][region]; if (region === currentRegionSelection) { formatToken(); - const datum = new Datum(Date.parse(data['current_time']), data['price_data'][region]); + datum = new Datum(Date.parse(data['update_times'][region]), data['price_data'][region]); if (currentAggregateSelection === 'none' && chart.active()) { await chart.addDataToChart(datum); }