fix: PAUSED mode disabled queries entirely instead of just polling
Some checks failed
CI / build (push) Successful in 1m49s
CI / cleanup-branch (push) Has been skipped
CI / deploy (push) Has been cancelled
CI / deploy-feature (push) Has been cancelled
CI / docker (push) Has been cancelled

useLiveQuery returned enabled:false when paused, which prevented
queries from running at all. Changed to enabled:true always —
PAUSED now means "fetch once, no polling" instead of "don't fetch".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-03 11:25:04 +02:00
parent 726e77bb91
commit 901dfd1eb8

View File

@@ -12,12 +12,12 @@ export function useRefreshInterval(intervalMs: number): number | false {
/**
* Returns `enabled` and `refetchInterval` tied to the LIVE/PAUSED toggle.
* - LIVE: enabled=true, refetchInterval=intervalMs (fetch + poll)
* - PAUSED: enabled=false, refetchInterval=false (no fetch at all)
* - PAUSED: enabled=true, refetchInterval=false (fetch once, no polling)
*/
export function useLiveQuery(intervalMs: number) {
const { autoRefresh } = useGlobalFilters();
return {
enabled: autoRefresh,
enabled: true,
refetchInterval: autoRefresh ? intervalMs : false as number | false,
};
}