BraydenMoore
commited on
Commit
•
0e2f38b
1
Parent(s):
40cdd39
Update templates/index.html
Browse files- templates/index.html +17 -17
templates/index.html
CHANGED
@@ -279,7 +279,22 @@
|
|
279 |
const response = await fetch(newUrl, { method: 'HEAD' });
|
280 |
if (!response.ok) { // If HTTP code is not OK (like 500)
|
281 |
console.error(`Fetch failed with status: ${response.status}`);
|
282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
return;
|
284 |
}
|
285 |
|
@@ -293,22 +308,7 @@
|
|
293 |
}
|
294 |
} catch (error) {
|
295 |
console.error('Fetch failed:', error);
|
296 |
-
|
297 |
-
|
298 |
-
if (urlParams.get('id')) {
|
299 |
-
firstLoad = false;
|
300 |
-
feed.style.width = "80px";
|
301 |
-
feed.style.height = "50px";
|
302 |
-
feed.src = loadingGif;
|
303 |
-
feed.style.opacity = "0.15";
|
304 |
-
countryElement.textContent = "couldn't connect.";
|
305 |
-
} else if (firstLoad) {
|
306 |
-
window.location.href = "?new=true";
|
307 |
-
} else {
|
308 |
-
firstLoad = false;
|
309 |
-
console.log("Trying again");
|
310 |
-
setTimeout(refreshImage, 250);
|
311 |
-
}
|
312 |
}
|
313 |
}
|
314 |
|
|
|
279 |
const response = await fetch(newUrl, { method: 'HEAD' });
|
280 |
if (!response.ok) { // If HTTP code is not OK (like 500)
|
281 |
console.error(`Fetch failed with status: ${response.status}`);
|
282 |
+
|
283 |
+
const urlParams = new URLSearchParams(window.location.search);
|
284 |
+
if (urlParams.get('id')) {
|
285 |
+
firstLoad = false;
|
286 |
+
feed.style.width = "80px";
|
287 |
+
feed.style.height = "50px";
|
288 |
+
feed.src = loadingGif;
|
289 |
+
feed.style.opacity = "0.15";
|
290 |
+
countryElement.textContent = "couldn't connect.";
|
291 |
+
} else if (firstLoad) {
|
292 |
+
window.location.href = "?new=true";
|
293 |
+
} else {
|
294 |
+
firstLoad = false;
|
295 |
+
console.log("Trying again");
|
296 |
+
setTimeout(refreshImage, 250);
|
297 |
+
}
|
298 |
return;
|
299 |
}
|
300 |
|
|
|
308 |
}
|
309 |
} catch (error) {
|
310 |
console.error('Fetch failed:', error);
|
311 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
}
|
313 |
}
|
314 |
|