BraydenMoore commited on
Commit
dafec20
1 Parent(s): b380d3b

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +7 -2
templates/index.html CHANGED
@@ -270,6 +270,7 @@
270
  const locationName = document.getElementById("location-name");
271
  const countryElement = document.getElementById("country");
272
  let firstLoad = true;
 
273
 
274
  const loadingGif = "{{ url_for('static', filename='eye.gif') }}";
275
  const newUrl = decodeURIComponent("{{ url|safe }}");
@@ -300,8 +301,10 @@
300
  if (response.ok) {
301
  if (/image\/jpe?g/.test(contentType)) {
302
  feed.src = newUrl + '?t=' + new Date().getTime();
 
303
  } else {
304
  feed.src = newUrl;
 
305
  }
306
  }
307
  } catch (error) {
@@ -317,8 +320,10 @@
317
  feed.style.opacity = "0.15";
318
  infoText.style.opacity = "0";
319
  locationName.textContent = "{{ page_title|safe }}";
320
-
321
- await refreshImage();
 
 
322
 
323
  feed.onload = function() {
324
  if (firstLoad) {
 
270
  const locationName = document.getElementById("location-name");
271
  const countryElement = document.getElementById("country");
272
  let firstLoad = true;
273
+ let isJpeg = false;
274
 
275
  const loadingGif = "{{ url_for('static', filename='eye.gif') }}";
276
  const newUrl = decodeURIComponent("{{ url|safe }}");
 
301
  if (response.ok) {
302
  if (/image\/jpe?g/.test(contentType)) {
303
  feed.src = newUrl + '?t=' + new Date().getTime();
304
+ isJpeg = true;
305
  } else {
306
  feed.src = newUrl;
307
+ isJpeg = false;
308
  }
309
  }
310
  } catch (error) {
 
320
  feed.style.opacity = "0.15";
321
  infoText.style.opacity = "0";
322
  locationName.textContent = "{{ page_title|safe }}";
323
+
324
+ if (isJpeg) {
325
+ setTimeout(refreshImage, 250);
326
+ }
327
 
328
  feed.onload = function() {
329
  if (firstLoad) {