diff --git a/src/fetchCurrent.js b/src/fetchCurrent.js index df56588..c24ebd9 100644 --- a/src/fetchCurrent.js +++ b/src/fetchCurrent.js @@ -1,4 +1,4 @@ export default async function fetchCurrent() { - const resp = await fetch("https://data.wowtoken.app/classic/token/current.json"); + const resp = await fetch("https://data.wowtoken.app/v2/current/classic.json"); return await resp.json(); } diff --git a/src/index.html b/src/index.html index cda2f9a..1e082a5 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,7 @@ - + @@ -42,6 +42,9 @@ + + + diff --git a/src/index.js b/src/index.js index 05a676c..b1eae0a 100644 --- a/src/index.js +++ b/src/index.js @@ -44,11 +44,11 @@ async function updateTokens(data) { } async function updateRegionalToken(region, data) { - if (currentPriceHash[region] !== data['price_data'][region]) { - currentPriceHash[region] = data['price_data'][region]; + if (currentPriceHash[region] !== data[region][1]) { + currentPriceHash[region] = data[region][1]; if (region === currentRegionSelection) { formatToken(); - datum = new Datum(Date.parse(data['update_times'][region]), data['price_data'][region]); + datum = new Datum(Date.parse(data[region][0]), data[region][1]); if (currentAggregateSelection === 'none' && chart.active()) { await chart.addDataToChart(datum); }