From fad28b05a1a92c34d2b313b3d7a6b506d8a199e1 Mon Sep 17 00:00:00 2001 From: Lyall Date: Mon, 30 Jun 2025 06:57:50 +0100 Subject: [PATCH] round time for consistent countdown --- src/pages/StatusPage.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index b398f5587..701ef4b90 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -806,7 +806,14 @@ export default { clearInterval(this.updateCountdown); this.updateCountdown = setInterval(() => { - const countdown = dayjs.duration(this.lastUpdateTime.add(Math.max(5, this.config.autoRefreshInterval), "seconds").diff(dayjs())); + const countdown = dayjs.duration( + Math.round( + this.lastUpdateTime + .add(Math.max(5, this.config.autoRefreshInterval), "seconds") + .diff(dayjs()) + / 1000 + ), "seconds"); + if (countdown.as("seconds") < 0) { clearInterval(this.updateCountdown); } else {