Spaces:
Running
Running
Commit
·
13793ca
1
Parent(s):
ca65fe2
Update templates/index.html
Browse files- templates/index.html +7 -2
templates/index.html
CHANGED
@@ -169,16 +169,21 @@
|
|
169 |
feed.src = "{{ url_for('static', filename='loading.gif') }}";
|
170 |
|
171 |
const newUrl = "{{ url }}";
|
|
|
|
|
|
|
|
|
172 |
|
173 |
const img = new Image();
|
174 |
img.onload = function() {
|
175 |
feed.src = this.src;
|
|
|
176 |
};
|
|
|
177 |
img.onerror = function() {
|
178 |
-
// Set error image or reload with new=true
|
179 |
-
// feed.src = "{{ url_for('static', filename='error.png') }}";
|
180 |
window.location.href = "?new=true";
|
181 |
};
|
|
|
182 |
img.src = newUrl;
|
183 |
});
|
184 |
</script>
|
|
|
169 |
feed.src = "{{ url_for('static', filename='loading.gif') }}";
|
170 |
|
171 |
const newUrl = "{{ url }}";
|
172 |
+
|
173 |
+
function refreshImage() {
|
174 |
+
img.src = newUrl + '?t=' + new Date().getTime();
|
175 |
+
}
|
176 |
|
177 |
const img = new Image();
|
178 |
img.onload = function() {
|
179 |
feed.src = this.src;
|
180 |
+
setTimeout(refreshImage, 500);
|
181 |
};
|
182 |
+
|
183 |
img.onerror = function() {
|
|
|
|
|
184 |
window.location.href = "?new=true";
|
185 |
};
|
186 |
+
|
187 |
img.src = newUrl;
|
188 |
});
|
189 |
</script>
|