This commit is contained in:
grove5_admin committed 2026-05-01 14:23:21 -07:00
1 parent 6802d6664a
commit bffa172a93
1 file changed
+3 -1
+3 -1
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { untrack } from 'svelte';
import { cultivar } from '../store.svelte';
import LineChart from '../charts/LineChart.svelte';
import InfoHint from './InfoHint.svelte';
@@ -73,8 +74,9 @@
const frHist = fruiting?.history ?? [];
const win = activeWin;
const now = Date.now();
const hadData = colSnap.length > 0 || fruitSnap.length > 0;
const hasData = colHist.length > 0 || frHist.length > 0;
// Use untrack when reading snap state to avoid infinite loop
const hadData = untrack(() => colSnap.length > 0 || fruitSnap.length > 0);
// Always update if: window changed, throttle expired, or transitioning from empty to data
if (win !== snapWin || now - snapMs >= winMs[win] || (!hadData && hasData)) {
colSnap = colHist.slice();