Skip to content

Commit

Permalink
fix: plus de top level await
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Dec 7, 2023
1 parent 60ef2e7 commit 171ede0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ let zonage = {
categorie_milieu: {},
milieu: {},
}
const response = await fetch(`${ALEXI_URL}/zonage.json`);
if (response.ok) {
zonage = await response.json();
}

window.addEventListener("load", async () => {
const response = await fetch(`${ALEXI_URL}/zonage.json`);
if (response.ok) {
zonage = await response.json();
}
});

function categorieTexte(info) {
const { zone, milieu, description } = info;
Expand Down

0 comments on commit 171ede0

Please sign in to comment.