diff --git a/ui/round/src/clock/clockCtrl.ts b/ui/round/src/clock/clockCtrl.ts index be7d06fc1b..711b4200fe 100644 --- a/ui/round/src/clock/clockCtrl.ts +++ b/ui/round/src/clock/clockCtrl.ts @@ -149,13 +149,11 @@ export class ClockController { if (color === undefined) return; const now = nowFun(); - const millis = this.times[color] - this.elapsed(now); + const millis = Math.max(0, this.times[color] - this.elapsed(now)); - if (millis <= 0) this.opts.onFlag(); - else { - this.scheduleTick(millis, 0); - updateElements(this, this.elements[color], millis); - } + this.scheduleTick(millis, 0); + if (millis === 0) this.opts.onFlag(); + else updateElements(this, this.elements[color], millis); if (this.opts.soundColor === color) { if (this.emergSound.playable[color]) {