fix: PAUSED mode disabled queries entirely instead of just polling
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:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user