fix(web):refresh dashboard session queries

This commit is contained in:
Anish Sarkar 2026-06-23 13:01:41 +05:30
parent be95f65c6b
commit b37114f193
5 changed files with 25 additions and 20 deletions

View file

@ -1,6 +1,6 @@
import { atomWithQuery } from "jotai-tanstack-query";
import { agentFlagsApiService } from "@/lib/apis/agent-flags-api.service";
import { getBearerToken } from "@/lib/auth-utils";
import { isAuthenticated } from "@/lib/auth-utils";
export const AGENT_FLAGS_QUERY_KEY = ["agent", "flags"] as const;
@ -12,6 +12,6 @@ export const AGENT_FLAGS_QUERY_KEY = ["agent", "flags"] as const;
export const agentFlagsAtom = atomWithQuery(() => ({
queryKey: AGENT_FLAGS_QUERY_KEY,
staleTime: 10 * 60 * 1000,
enabled: !!getBearerToken(),
enabled: isAuthenticated(),
queryFn: () => agentFlagsApiService.get(),
}));