diff --git a/ui/src/hooks/use-cliproxy-stats.ts b/ui/src/hooks/use-cliproxy-stats.ts index cc9cf222..3b9d43d0 100644 --- a/ui/src/hooks/use-cliproxy-stats.ts +++ b/ui/src/hooks/use-cliproxy-stats.ts @@ -225,8 +225,10 @@ export function useAccountQuota(provider: string, accountId: string, enabled = t queryKey: ['account-quota', provider, accountId], queryFn: () => fetchAccountQuota(provider, accountId), enabled: enabled && provider === 'agy' && !!accountId, - staleTime: 30000, // Consider stale after 30s (tokens can refresh anytime) + staleTime: 60000, // Match refetchInterval to prevent early refetching refetchInterval: 60000, // Refresh every 1 minute + refetchOnWindowFocus: false, // Don't refetch on tab switch + refetchOnMount: false, // Don't refetch on component remount (AuthMonitor re-renders) retry: 1, }); }