From cca86ff53efb8c906f64692b2934f8baaf741140 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 08:43:07 +0000 Subject: [PATCH] fix: Initialize lastPollTime on first RAF callback Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com> --- src/stores/useMachineStore.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stores/useMachineStore.ts b/src/stores/useMachineStore.ts index 553b856..f1d3b1a 100644 --- a/src/stores/useMachineStore.ts +++ b/src/stores/useMachineStore.ts @@ -382,6 +382,11 @@ export const useMachineStore = create((set, get) => ({ // - Smoother animations and UI updates // - More efficient rendering const poll = async (timestamp: number) => { + // Initialize lastPollTime on first call + if (lastPollTime === 0) { + lastPollTime = timestamp; + } + // Check if enough time has passed since last poll const interval = getPollInterval(); const elapsed = timestamp - lastPollTime;