We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e9e30a commit b7a3fe7Copy full SHA for b7a3fe7
1 file changed
web/index.html
@@ -28,10 +28,15 @@
28
<body>
29
<div id="map"></div>
30
<script>
31
+ let fogInitialized = false;
32
new MutationObserver(() => {
33
const f = document.querySelector('.leaflet-fog-of-war');
- if (!f) location.reload();
34
- else if (f.style.display === 'none') f.style.display = 'block';
+ if (f) {
35
+ fogInitialized = true;
36
+ if (f.style.display === 'none') f.style.display = 'block';
37
+ } else if (fogInitialized) {
38
+ location.reload();
39
+ }
40
}).observe(document.getElementById('map'), { childList: true, subtree: true });
41
</script>
42
</body>
0 commit comments