diff --git a/app/package-lock.json b/app/package-lock.json index f460e66..7647171 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "jwe", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jwe", - "version": "2.0.0", + "version": "2.0.1", "dependencies": { "mapillary-js": "^4.1.2", "maplibre-gl": "^5.1.0", diff --git a/app/package.json b/app/package.json index 728a656..dd28042 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "jwe", - "version": "2.0.0", + "version": "2.0.1", "private": true, "type": "module", "scripts": { diff --git a/app/src/lib/components/GameMap.svelte b/app/src/lib/components/GameMap.svelte index 403037f..49bc3f8 100644 --- a/app/src/lib/components/GameMap.svelte +++ b/app/src/lib/components/GameMap.svelte @@ -326,7 +326,13 @@ let ancienReal: Coordonnees | null = null; $effect(() => { - if (!map || !map.loaded()) return; + // Lecture inconditionnelle de `real` : au montage la carte n'existe pas + // encore, et un retour anticipé avant toute lecture réactive ferait que + // Svelte n'enregistre aucune dépendance — l'effet ne serait jamais relancé. + // (isStyleLoaded et non loaded : loaded() reste faux pendant le chargement + // des tuiles, ce qui ferait rater le dessin juste après un zoom/pan.) + void real; + if (!map || !map.isStyleLoaded()) return; if (real && !ancienReal) dessinerRevelation(); if (!real && ancienReal) nettoyerRevelation(); ancienReal = real;