Spaces:
Running
Running
Commit
·
a334dad
1
Parent(s):
cd9ca20
Update templates/index.html
Browse files- templates/index.html +12 -8
templates/index.html
CHANGED
@@ -327,17 +327,21 @@
|
|
327 |
|
328 |
const urlParams = new URLSearchParams(window.location.search);
|
329 |
const countryElement = document.getElementById("country");
|
|
|
330 |
if (urlParams.get('id')) {
|
331 |
countryElement.textContent = "couldn't connect.";
|
332 |
-
}
|
333 |
-
else if (firstLoad === true) {
|
334 |
window.location.href = "?new=true";
|
335 |
-
}
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
|
|
|
|
341 |
|
342 |
img.src = newUrl;
|
343 |
});
|
|
|
327 |
|
328 |
const urlParams = new URLSearchParams(window.location.search);
|
329 |
const countryElement = document.getElementById("country");
|
330 |
+
|
331 |
if (urlParams.get('id')) {
|
332 |
countryElement.textContent = "couldn't connect.";
|
333 |
+
} else if (firstLoad === true) {
|
|
|
334 |
window.location.href = "?new=true";
|
335 |
+
} else {
|
336 |
+
console.log('Error loading, trying again.');
|
337 |
+
if (retryCount < maxRetries) {
|
338 |
+
setTimeout(refreshImage, 250);
|
339 |
+
retryCount++;
|
340 |
+
} else {
|
341 |
+
console.log('Max retry attempts reached.');
|
342 |
+
}
|
343 |
+
}
|
344 |
+
};
|
345 |
|
346 |
img.src = newUrl;
|
347 |
});
|