From 10e9416f8f1abe4cda334242821157bd7c486986 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 3 Nov 2024 19:02:16 +0100 Subject: [PATCH] Fix: when using Chronic, check the `aslong` condition before actually running instead of using it to reset the clock. --- src/Logic/UIEventSource.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Logic/UIEventSource.ts b/src/Logic/UIEventSource.ts index bf421b509e..cca361d185 100644 --- a/src/Logic/UIEventSource.ts +++ b/src/Logic/UIEventSource.ts @@ -9,13 +9,14 @@ export class Stores { const source = new UIEventSource(undefined) function run() { + if(asLong !== undefined && !asLong()){ + return + } source.setData(new Date()) if (Utils.runningFromConsole) { return } - if (asLong === undefined || asLong()) { - window.setTimeout(run, millis) - } + window.setTimeout(run, millis) } run()