mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
fix(dashboard): refetch the snapshot on window focus
The dashboard is exactly the surface a user leaves open in a background tab while editing its tile selection elsewhere; with focus refetch off, the stale layout sat visible for up to the poll interval — a save appeared to do nothing, then 'worked' minutes later. staleTime still bounds the refetch to once a minute and the server side is SWR-cached, so a focus flick is a cheap cache hit. Chart batch series stay on the poll (heavier payloads; the tile selection itself lives on the snapshot query).
This commit is contained in:
1 parent
13464b512e
commit
8ee9c53b83
1 file changed
+7
-1
@@ -65,7 +65,13 @@ import { VorsorgeDashboardCard } from "@/components/measurement-reminders/vorsor
|
||||
// but the slot is one future-callback-field away from cache poisoning.
|
||||
const DASHBOARD_QUERY_OPTS = {
|
||||
staleTime: 60_000,
|
||||
refetchOnWindowFocus: false,
|
||||
// v1.28.28 — refetch on window focus: the dashboard is exactly the surface
|
||||
// a user leaves open in a background tab while editing its tile selection
|
||||
// elsewhere; without a focus refetch the stale layout sat visible for up to
|
||||
// the poll interval ("saved but nothing changed"). staleTime still bounds
|
||||
// the cost to at most one refetch per minute, and the server side is SWR-
|
||||
// cached, so a focus flick is a cheap cache hit.
|
||||
refetchOnWindowFocus: true,
|
||||
} as const;
|
||||
|
||||
// v1.19.0 — day-span the batched dashboard series (`series-batch`) fetches.
|
||||
|
||||
Reference in new issue
Block a user