fix(header): keep the sync-status count live (focus refetch + background poll)

The header 'N without full history' (and sync state) polled every 30s but only while
the tab was focused, and the global refetchOnWindowFocus is off — so after switching
tabs the count looked frozen until a manual reload. Poll in the background too and
refetch on focus so it tracks the scheduler's progress without F5.
This commit is contained in:
npeter83 2026-06-15 17:00:06 +02:00
parent 639d761bef
commit 2e536afe21

View file

@ -20,7 +20,12 @@ export default function SyncStatus({
const { data } = useQuery({
queryKey: ["my-status"],
queryFn: api.myStatus,
// Track the scheduler near-real-time: poll even when the tab is backgrounded, and
// refresh immediately on tab focus (the global default disables focus refetch), so the
// "N without full history" count keeps ticking down without a manual reload.
refetchInterval: 30_000,
refetchIntervalInBackground: true,
refetchOnWindowFocus: true,
staleTime: 25_000,
});