chore(usage): stop polling /users/me and token-status for live fields

This commit is contained in:
Anish Sarkar 2026-05-02 03:32:58 +05:30
parent 38a4742ec6
commit b9b4d0b377
2 changed files with 4 additions and 10 deletions

View file

@ -8,7 +8,10 @@ const userQueryFn = () => userApiService.getMe();
export const currentUserAtom = atomWithQuery(() => {
return {
queryKey: USER_QUERY_KEY,
staleTime: 5 * 60 * 1000,
// Live-changing numeric fields (pages_*, premium_tokens_*) are now
// pushed via Zero (queries.user.me()), so /users/me only needs to
// fire once per session for the static profile fields.
staleTime: Infinity,
enabled: !!getBearerToken(),
queryFn: userQueryFn,
};