Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Snekw committed Apr 2, 2024
1 parent 3277665 commit b567467
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,27 @@ dashboard.onResize(() => {
await Promise.all([
new Promise(async (resolve) => {
console.time('loading covid data')
covidData = await fetch(document.head.baseURI + 'examples/assets/1111/owid-covid-data.json').then((r) => r.json())
covidData = await fetch(
new URL(document.head.baseURI).origin +
new URL(document.head.baseURI).pathname +
'examples/assets/1111/owid-covid-data.json',
).then((r) => r.json())
console.timeEnd('loading covid data')
resolve()
}),
new Promise(async (resolve) => {
console.time('loading covid vaccinations data')
vaccinationData = await fetch(document.head.baseURI + 'examples/assets/1111/vaccinations.json').then((r) => r.json())
vaccinationData = await fetch(
new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'examples/assets/1111/vaccinations.json',
).then((r) => r.json())
console.timeEnd('loading covid vaccinations data')
resolve()
}),
new Promise(async (resolve) => {
console.time('loading country locations data')
countriesData = await fetch(document.head.baseURI + 'examples/assets/1111/countries.json').then((r) => r.json())
countriesData = await fetch(
new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'examples/assets/1111/countries.json',
).then((r) => r.json())
console.timeEnd('loading country locations data')
resolve()
}),
Expand Down

0 comments on commit b567467

Please sign in to comment.