mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
round time for consistent countdown
This commit is contained in:
parent
b99ac01e5c
commit
fad28b05a1
1 changed files with 8 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue