fix(profile,connected-accounts): drop dead ['user'] invalidate calls

queryClient.invalidateQueries({ queryKey: ['user'] }) appears twice in
the codebase but no useQuery with that key is registered anywhere — the
auth user is a zustand store, not a React Query cache entry. The
invalidations were silent no-ops that suggested wiring that did not
exist.

The actual refresh path (await getMe + setUser) was already in place
right above each invalidate, so the cleanup is purely cosmetic +
documentation: replace with a comment explaining where the user state
actually lives, so the next reader doesn't try to invalidate it again.
This commit is contained in:
c0mrade
2026-05-26 13:58:33 +03:00
parent bef984d72a
commit 23e4e9b4d1
2 changed files with 4 additions and 2 deletions

View File

@@ -404,7 +404,8 @@ export default function ConnectedAccounts() {
const updatedUser = await authApi.getMe();
setUser(updatedUser);
queryClient.invalidateQueries({ queryKey: ['linked-providers'] });
queryClient.invalidateQueries({ queryKey: ['user'] });
// Note: auth user lives in the zustand store, not in React Query —
// the explicit setUser above IS the refresh. No ['user'] query exists.
},
onError: (err: { response?: { data?: { detail?: string } } }) => {
const detail = err.response?.data?.detail;

View File

@@ -193,7 +193,8 @@ export default function Profile() {
setChangeEmailStep('success');
const updatedUser = await authApi.getMe();
setUser(updatedUser);
queryClient.invalidateQueries({ queryKey: ['user'] });
// Note: auth user lives in the zustand store, not in React Query —
// the explicit setUser above IS the refresh. No ['user'] query exists.
},
onError: (err: { response?: { data?: { detail?: string } } }) => {
const detail = err.response?.data?.detail;