Delay manual snapshot refresh

This commit is contained in:
2026-08-03 01:40:15 +02:00
parent 6b2bc3853a
commit 15ec93f82e
2 changed files with 12 additions and 1 deletions
+5 -1
View File
@@ -1,3 +1,5 @@
const SNAPSHOT_REFRESH_DELAY_MS = 2000;
function formatRemaining(totalSeconds) {
const seconds = Math.max(0, Math.ceil(totalSeconds));
const minutes = Math.floor(seconds / 60);
@@ -122,7 +124,9 @@ function refreshSnapshot(button) {
button.setAttribute("aria-busy", "true");
image.addEventListener("load", cleanup, { once: true });
image.addEventListener("error", cleanup, { once: true });
image.src = url.toString();
window.setTimeout(() => {
image.src = url.toString();
}, SNAPSHOT_REFRESH_DELAY_MS);
}
document.addEventListener("click", (event) => {